Re: [RFC] mmiotrace full patch, preview 1

From: Andy Whitcroft
Date: Tue Feb 26 2008 - 05:21:25 EST


On Mon, Feb 25, 2008 at 06:34:49PM -0500, Christoph Hellwig wrote:
> On Mon, Feb 25, 2008 at 02:49:22PM -0800, Andrew Morton wrote:
> > the things which it finds.
> >
> > > +static DECLARE_MUTEX(kmmio_init_mutex);
> >
> > That's not a mutex.
> >
> > > + down(&kmmio_init_mutex);
> >
> > It's a semaphore. Please do convert it to a mutex.
> >
> > Andy, I'd say that addition of new semaphores is worth a warning - they're
> > rarely legitimate.
>
> I'm not sure that any semaphore should be a warning, but the initializer
> for semaphore used as binary mutex (DECLARE_MUTEX and init_MUTEX) are
> worth it.

Ok, so that would be the following, work for everyone?

WARNING: mutexes are preferred for single holder semaphores
#1: FILE: Z95.c:1:
+ DECLARE_MUTEX(&foo);

WARNING: mutexes are preferred for single holder semaphores
#3: FILE: Z95.c:3:
+ init_MUTEX(&foo);

-apw
--
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/