Re: [PATCH 1/3][-mm] add class_reclassify macro
From: Greg KH
Date: Wed May 28 2008 - 12:09:34 EST
On Wed, May 28, 2008 at 09:48:40AM -0600, Matthew Wilcox wrote:
> On Mon, May 26, 2008 at 11:59:34PM -0700, Andrew Morton wrote:
> > If that semaphore is being used as a mutex then we should convert it to
> > a mutex (dammit).
>
> Right.
>
> > Leaving it implemented as a semphore is not the proper way of
> > suppressing the lockdep warnings. It would be better to convert it to
> > a mutex then add suitable (and suitably commented) open-coded lockdep
> > annotations to suppress the runtime warnings.
>
> We don't even have to go that far. Here's all that's needed:
>
> diff -u a/drivers/base/class.c b/drivers/base/class.c
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -134,7 +134,7 @@
> }
> }
>
> -int class_register(struct class *cls)
> +int __class_register(struct class *cls, struct lock_class_key *key)
Sorry, this will not work properly, as class_create() is now more
commonly called, and it calls class_register() from within the driver
core. So there would be a lot of classes with the same "key" because of
this.
So try changing class_create also.
thanks,
greg k-h
--
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/