lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091019094909.GC27856@wotan.suse.de>
Date:	Mon, 19 Oct 2009 11:49:09 +0200
From:	Nick Piggin <npiggin@...e.de>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Al Viro <viro@...iv.linux.org.uk>, linux-fsdevel@...r.kernel.org,
	Ian Kent <raven@...maw.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 4/6] brlock: introduce special brlocks

On Sun, Oct 18, 2009 at 10:25:12PM -0700, Andrew Morton wrote:
> On Thu, 15 Oct 2009 15:40:30 +1100 npiggin@...e.de wrote:
> 
> > +#define DECLARE_BRLOCK(name)						\
> 
> This:
> 
> > + DECLARE_PER_CPU(spinlock_t, name##_lock);				\
> > + static inline void name##_lock_init(void) {				\
> > +	int i;								\
> > +	for_each_possible_cpu(i) {					\
> > +		spinlock_t *lock;					\
> > +		lock = &per_cpu(name##_lock, i);			\
> > +		spin_lock_init(lock);					\
> > +	}								\
> > + }									\
> > + static inline void name##_rlock(void) {				\
> > +	spinlock_t *lock;						\
> > +	lock = &get_cpu_var(name##_lock);				\
> > +	spin_lock(lock);						\
> > + }									\
> 
> generates a definition, not a declaration.  Hence DEFINE_BRLOCK.
> 
> </petpeeve #29>

Well yes, but being a static inline, then I don't know of a better 
way. Probably just better not to pretend we are expanding a simple
declaration here, and name it something differently? (BRLOCK_HEADER(blah))?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ