lkml.org 
[lkml]   [2004]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ppcfix.diff
On Mon, Nov 29, 2004 at 11:40:41PM +0800, hugang@soulinfo.com wrote:
> if (!cpus_empty(keepmask)) {
> - cpumask_t irqdest = { .bits[0] = openpic_read(&ISR[irq]->Destination) };
> + cpumask_t irqdest;
> + irqdest.bits[0] = openpic_read(&ISR[irq]->Destination);

Not an equivalent replacement. The former means "set irqdest.bits[0] to
<expression> and set the rest of fields/array elements in them to zero/null".
The latter leaves everything except irqdest.bits[0] undefined.

Short version of the story: out of
a) cpumask_t irqdest = { .bits[0] = foo() };
b) cpumask_t irqdest = { .bits = {[0] = foo()} };
c) cpumask_t irqdest;
irqdest.bits[0] = foo();
we have
valid C89 OK for 2.95 OK for 3.x valid C99 initializes everything
(a) no no yes yes yes
(b) no yes yes yes yes
(c) yes yes yes yes no

IOW, 2.95 implements only a precursor to C99 initializer syntax and that's
why (a) gives an error. Proper fix is (b) - replace the line in question
with
cpumask_t irqdest = { .bits = {[0] = openpic_read(&ISR[irq]->Destination)} };
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:08    [W:0.056 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site