lkml.org 
[lkml]   [2008]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rfc git pull] cpus4096 fixes, take 2

* Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Tuesday 29 July 2008 06:57:00 Ingo Molnar wrote:
> > +/*
> > + * In cases where we take the address of the cpumask immediately,
> > + * gcc optimizes it out (it's a constant) and there's no huge stack
> > + * variable created:
> > + */
> > +#define cpumask_of_cpu(cpu) ({ *get_cpu_mask(cpu); })
>
> Why use a statement expression here? Isn't (*get_cpu_mask(cpu))
> sufficient?

Yeah, it's sufficient - no strong reasons - it felt a slightly bit more
correct to isolate the read-only data structure. Not that it makes any
real difference in practice - it's still possible to take the address of
get_cpu_mask() and abuse that - gcc will only issue a warning.

But gcc 3.4.5 apparently craps out on this valid use of a gcc extension,
see the report and the fix at:

http://lkml.org/lkml/2008/7/29/154

Ingo


\
 
 \ /
  Last update: 2008-07-29 14:15    [W:0.081 / U:3.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site