Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Christoph Hellwig
On Mon, May 05, 2008 at 12:13:43PM +1000, Paul Mackerras wrote: > Sean MacLennan writes: > > > This is a bit OT, but I got the warning in the subject from > > checkpatch.pl for a piece of code. The code *is* using a mutex. Does it > > actually mean I shouldn't use a mutex? > > I don't require zer

Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Sean MacLennan
On Mon, 05 May 2008 13:38:39 +1000 "Benjamin Herrenschmidt" <[EMAIL PROTECTED]> wrote: > Show us the code... It could be a bug in checkpatch or you using > the wrong functions somewhere ... The change to DEFINE_MUTEX and changing up/down to mutex_lock/mutex_unlock solved the problem. The code i

Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Benjamin Herrenschmidt
On Sun, 2008-05-04 at 20:41 -0400, Sean MacLennan wrote: > This is a bit OT, but I got the warning in the subject from > checkpatch.pl for a piece of code. The code *is* using a mutex. Does it > actually mean I shouldn't use a mutex? > > The code declares a global mutex: > > static DECLARE

Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Paul Mackerras
Sean MacLennan writes: > This is a bit OT, but I got the warning in the subject from > checkpatch.pl for a piece of code. The code *is* using a mutex. Does it > actually mean I shouldn't use a mutex? I don't require zero checkpatch warnings or errors on patches before I accept them. If what chec

Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Sean MacLennan
On Mon, 05 May 2008 11:06:55 +1000 "Michael Ellerman" <[EMAIL PROTECTED]> wrote: > On Sun, 2008-05-04 at 20:41 -0400, Sean MacLennan wrote: > > This is a bit OT, but I got the warning in the subject from > > checkpatch.pl for a piece of code. The code *is* using a mutex. > > Does it actually mean

Re: WARNING: mutexes are preferred for single holder semaphores

2008-05-04 Thread Michael Ellerman
On Sun, 2008-05-04 at 20:41 -0400, Sean MacLennan wrote: > This is a bit OT, but I got the warning in the subject from > checkpatch.pl for a piece of code. The code *is* using a mutex. Does it > actually mean I shouldn't use a mutex? > > The code declares a global mutex: > > static DECLARE_