public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: akinobu.mita@gmail.com, nickpiggin@yahoo.com.au,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] lib: introduce call_once()
Date: Tue, 11 Mar 2008 12:11:07 -0700	[thread overview]
Message-ID: <20080311121107.4774ff5e.akpm@linux-foundation.org> (raw)
In-Reply-To: <1205261815.3165.21.camel@localhost>

On Tue, 11 Mar 2008 11:56:55 -0700
Joe Perches <joe@perches.com> wrote:

> On Tue, 2008-03-11 at 10:35 -0700, Andrew Morton wrote:
> > #define ONCE()                                              \
> >     ({                                              \
> >             static long flag;                       \
> >                                                     \
> >             return !test_and_set_bit(0, flag);      \
> >     })
> 
> test_and_set_bit takes an address

duh.

> Perhaps:
> 
> #define DO_ONCE(x) \
> 	({ static long flag; if (test_and_set_bit(0, &flag)) x; 1; })
> 
> DO_ONCE(foo);

No, that's completely unnecessary and would produce nasty-looking code. 
Take a look at some of the wait_event monstrosities we have.


I'm not sure that we need any of this once() stuff really.

  reply	other threads:[~2008-03-11 19:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10 14:57 [PATCH 1/5] lib: introduce call_once() Akinobu Mita
2008-03-10 15:00 ` [PATCH 2/5] idr: use call_once() Akinobu Mita
2008-03-10 15:01   ` [PATCH 3/5] hugetlbfs: " Akinobu Mita
2008-03-10 15:03     ` [PATCH 4/5] shmem: " Akinobu Mita
2008-03-10 15:05       ` [PATCH 5/5] tiny-shmem: " Akinobu Mita
2008-03-10 22:15       ` [PATCH 4/5] shmem: " Hugh Dickins
2008-03-11 12:29         ` Akinobu Mita
2008-03-11 13:41           ` Hugh Dickins
2008-03-10 15:29 ` [PATCH 1/5] lib: introduce call_once() Joe Perches
2008-03-11 12:17   ` Akinobu Mita
2008-03-11  3:48 ` Andrew Morton
2008-03-11  4:10   ` Nick Piggin
2008-03-11  4:21     ` Andrew Morton
2008-03-11 12:27       ` Akinobu Mita
2008-03-11 17:35         ` Andrew Morton
2008-03-11 18:56           ` Joe Perches
2008-03-11 19:11             ` Andrew Morton [this message]
2008-03-15  4:01           ` Akinobu Mita
2008-03-11 12:41 ` Nick Piggin

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=20080311121107.4774ff5e.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=akinobu.mita@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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