linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Sean MacLennan <seanm@seanm.ca>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: WARNING: mutexes are preferred for single holder semaphores
Date: Mon, 05 May 2008 11:06:55 +1000	[thread overview]
Message-ID: <1209949615.8159.7.camel@localhost> (raw)
In-Reply-To: <20080504204104.7eea7618@lappy.seanm.ca>

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

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_MUTEX(list_lock);

.. which is a semaphore :(  [see include/linux/semaphore.h]

I think you want DEFINE_MUTEX().

Yes, this is completely ridiculous.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-05-05  1:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05  0:41 WARNING: mutexes are preferred for single holder semaphores Sean MacLennan
2008-05-05  1:06 ` Michael Ellerman [this message]
2008-05-05  1:31   ` Sean MacLennan
2008-05-05  2:13 ` Paul Mackerras
2008-05-05  6:01   ` Christoph Hellwig
2008-05-05  3:38 ` Benjamin Herrenschmidt
2008-05-05  4:40   ` Sean MacLennan
2008-05-07 14:36     ` All your drivers are belong to us [was WARNING: mutexes are preferred for single holder semaphores] Detlev Zundel
2008-05-07 21:42       ` All your drivers are belong to us [was WARNING: mutexes are preferredfor " Sean MacLennan
2008-05-08  0:49         ` Josh Boyer
2008-05-08  4:41           ` Sean MacLennan
2008-05-08 13:28           ` All your drivers are belong to us Detlev Zundel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1209949615.8159.7.camel@localhost \
    --to=michael@ellerman.id.au \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=seanm@seanm.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).