[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <961aa3350803110517o6abc7fc4rf4a0f241f5351b9c@mail.gmail.com>
Date: Tue, 11 Mar 2008 21:17:05 +0900
From: "Akinobu Mita" <akinobu.mita@...il.com>
To: "Joe Perches" <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [PATCH 1/5] lib: introduce call_once()
2008/3/11, Joe Perches <joe@...ches.com>:
> On Mon, 2008-03-10 at 23:57 +0900, Akinobu Mita wrote:
> > +++ 2.6-rc/include/linux/once.h
>
> > +struct once_control {
> > + struct mutex lock;
> > + int done;
>
>
> bool?
Yes, this definetly should be bool.
> > +};
> > +
> > +#define __ONCE_INITIALIZER(name) { \
> > + .lock = __MUTEX_INITIALIZER(name.lock), \
> > + .done = 0, \
> > + }
> > +
> > +#define DEFINE_ONCE(name) struct once_control name = __ONCE_INITIALIZER(name)
>
>
> static?
no, static keyword should not be implicitly added in this macro.
DEFINE_ONCE is intended to be anologous to DEFINE_LOCK, DEFINE_WAIT,
and all other similar interfaces in kernel.
> > +
> > +extern int call_once_slow(struct once_control *once_control,
> > + int (*init_rouine)(void));
>
>
> return bool?
call_once() returns error-code when init_routine fails.
> spelling: s/rouine/routine/g
Oops, thanks.
--
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