lkml.org 
[lkml]   [2009]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 4/6] brlock: introduce special brlocks
On Mon, 19 Oct 2009 11:49:09 +0200 Nick Piggin <npiggin@suse.de> wrote:

> On Sun, Oct 18, 2009 at 10:25:12PM -0700, Andrew Morton wrote:
> > On Thu, 15 Oct 2009 15:40:30 +1100 npiggin@suse.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))?

DEFINE_BRLOCK(blah)


\
 
 \ /
  Last update: 2009-10-19 14:29    [W:0.078 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site