Re: [PATCH] Drop second arg of unregister_chrdev()

From: Andrew Morton
Date: Mon Aug 14 2006 - 23:45:48 EST


On Tue, 15 Aug 2006 07:35:22 +0400
Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> * "name" is trivially unused.

OK.

> * Requirement to pass to unregister function anything but cookie you've
> got from register counterpart is wrong. It creates opportunity to
> diverge, it create opportunity for bugs if enforced:
>
> /*
> * XXX(hch): bp->b_count_desired might be incorrect (see
> * xfs_buf_associate_memory for details),
>
> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
>
> * but fortunately
> * the Linux version of kmem_free ignores the len argument..
> */
> kmem_free(bp->b_addr, bp->b_count_desired);

I don't understand that.

> 64 files changed, 97 insertions(+), 97 deletions(-)

I do understand that. This'll cause some grief. I'd suggest that we add a
new unregister_char_dev() or something, and do

static inline unregister_chrdev(unsigned int major, const char *name)
{
return unregister_char_dev(major);
}

then migrate callers over to unregister_char_dev() in an organised fashion,
via maintainers where poss.

Then mark unregister_chrdev() deprecated for a while.

Then nuke it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/