From: Joel Soete <soete.joel@tiscali.be>
To: Carlos O'Donell <carlos@baldric.uwo.ca>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
Kyle McMartin <kyle@mcmartin.ca>,
PARISC list <parisc-linux@lists.parisc-linux.org>
Subject: Re: [parisc-linux] memory barriers, spinlocks, debuglocks, oh my
Date: Sat, 28 Aug 2004 16:57:57 +0000 [thread overview]
Message-ID: <4130B995.4060201@tiscali.be> (raw)
In-Reply-To: <20040827170342.GD25975@baldric.uwo.ca>
Carlos O'Donell wrote:
> On Fri, 2004-08-27 at 12:37, Kyle McMartin wrote:
[...]
>>
>>if (<some statement>)
>> spin_lock_init(x);
>
>
> I always recommend macros should be encased with "({ ... })" which give
> you a new scope for variable declarations aswell.
>
Do I well undesrtand: replace e.g.
#define SPIN_LOCK_IRQSAVE(l,f) do { \
spinlock_t *s = ATOMIC_HASH(l); \
local_irq_save(f); \
spin_lock(s); \
} while(0)
by
#define SPIN_LOCK_IRQSAVE(l,f) ({ \
spinlock_t *s = ATOMIC_HASH(l); \
local_irq_save(f); \
spin_lock(s); \
})
I admit that I never find the right way to choose between those 2 forms?
TIA,
Joel
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
next prev parent reply other threads:[~2004-08-28 16:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-27 16:37 [parisc-linux] memory barriers, spinlocks, debuglocks, oh my Kyle McMartin
[not found] ` <1093625820.2010.26.camel@mulgrave>
[not found] ` <20040827170342.GD25975@baldric.uwo.ca>
2004-08-28 16:57 ` Joel Soete [this message]
2004-08-28 17:07 ` Kyle McMartin
2004-08-28 22:15 ` Kyle McMartin
2004-08-29 16:11 ` Joel Soete
2004-08-29 16:13 ` Kyle McMartin
2004-08-30 4:06 ` Grant Grundler
2004-08-30 4:14 ` Kyle McMartin
2004-08-30 4:30 ` Grant Grundler
2004-08-30 4:37 ` Kyle McMartin
2004-08-29 16:14 ` Thibaut VARENE
2004-08-29 17:45 ` John David Anglin
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=4130B995.4060201@tiscali.be \
--to=soete.joel@tiscali.be \
--cc=James.Bottomley@SteelEye.com \
--cc=carlos@baldric.uwo.ca \
--cc=kyle@mcmartin.ca \
--cc=parisc-linux@lists.parisc-linux.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