mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Mike Travis <travis@sgi.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpumask: introduce new API, without changing anything
Date: Fri, 7 Nov 2008 09:57:46 +0100	[thread overview]
Message-ID: <20081107085746.GB27245@elte.hu> (raw)
In-Reply-To: <20081107005229.53d6f2e3.akpm@linux-foundation.org>


* Andrew Morton <akpm@linux-foundation.org> wrote:

> > +#if NR_CPUS == 1
> > +/* Uniprocesor. */

btw: s/Uniprocesor/Uniprocessor

> > +#define cpumask_first(src)		({ (void)(src); 0; })
> >
> > ...
> >
> > +#else
> > +static inline unsigned int cpumask_first(const struct cpumask *srcp)
> > +{
> > +	return find_first_bit(cpumask_bits(srcp), nr_cpumask_bits);
> > +}
> >
> > ...
> >
> > +#endif /* SMP */
> 
> So I can happily compile and run
> 
> 	cpumask_first("hello, world");
> 
> with CONFIG_SMP=n?

yeah, you are right that the use of a macro sucks there, it should be 
an inline function.

We should stop using CPP, which is the outdated tech of the sixties. 
We should go with the new wave of the seventies and use this shiny new 
"C" language that's all the rage with features like type checking and 
stuff.

	Ingo

  reply	other threads:[~2008-11-07  8:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081029152849.3883d072.sfr@canb.auug.org.au>
     [not found] ` <200811021229.16061.rusty@rustcorp.com.au>
     [not found]   ` <alpine.LFD.2.00.0811011834360.3483@nehalem.linux-foundation.org>
2008-11-06 22:49     ` Rusty Russell
2008-11-07  8:40       ` Ingo Molnar
2008-11-07  8:52         ` Andrew Morton
2008-11-07  8:57           ` Ingo Molnar [this message]
2008-11-07 11:32           ` Rusty Russell
2008-11-07  9:11         ` Stephen Rothwell
2008-11-07  9:39           ` Ingo Molnar
2008-11-07 12:24             ` Ingo Molnar
2008-11-07 18:17               ` Mike Travis
2008-11-08  9:24               ` Rusty Russell
2008-11-08 12:28                 ` Ingo Molnar
2008-11-10 18:16                   ` Mike Travis
2008-11-09 20:01                 ` Linus Torvalds
2008-11-09 20:16                   ` Ingo Molnar
2008-11-09 21:37                     ` Ingo Molnar
2008-11-09 21:46                   ` Rusty Russell

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=20081107085746.GB27245@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=travis@sgi.com \
    /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

all inboxes | Powered by JetHome®