lkml.org 
[lkml]   [2008]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpumask: introduce new API, without changing anything

* 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


\
 
 \ /
  Last update: 2008-11-07 10:01    [W:0.077 / U:0.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site