mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@firmix.at>
To: "Kotian, Deepak" <Deepak.Kotian@patni.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Purpose of do{}while(0) in #define spin_lock_init(x)	do { (x)->lock = 0; } while(0)
Date: Wed, 05 Jan 2005 15:15:14 +0100	[thread overview]
Message-ID: <1104934513.28504.18.camel@tara.firmix.at> (raw)
In-Reply-To: <374639AB1012AA4C840022842AA95BC203E0E7E3@ruby.patni.com>

On Wed, 2005-01-05 at 19:31 +0530, Kotian, Deepak wrote:
> Is there any specific reason why do{}while(0) is 
> there in this definition
> #define spin_lock_init(x)	do { (x)->lock = 0; } while(0)
> 
> What could happen if it is replaced by
> #define spin_lock_init(x)	{ (x)->lock = 0; } 

http://kernelnewbies.org/faq/index.php3#dowhile

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


      parent reply	other threads:[~2005-01-05 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-05 14:01 Kotian, Deepak
2005-01-05 14:14 ` Paolo Ornati
2005-01-05 14:15 ` Bernd Petrovitsch [this message]

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=1104934513.28504.18.camel@tara.firmix.at \
    --to=bernd@firmix.at \
    --cc=Deepak.Kotian@patni.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®