mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: hugang@soulinfo.com
Cc: akpm@digeo.com, linux-kernel@vger.kernel.org
Subject: Re: ppcfix.diff
Date: Mon, 29 Nov 2004 17:22:52 +0000	[thread overview]
Message-ID: <20041129172252.GN26051@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20041129154041.GB4616@hugang.soulinfo.com>

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)} };

  parent reply	other threads:[~2004-11-29 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-29 15:40 ppcfix.diff hugang
2004-11-29 16:42 ` ppcfix.diff Jan Engelhardt
2004-11-29 17:04   ` ppcfix.diff Adrian Bunk
2004-11-29 17:22 ` Al Viro [this message]
2004-11-29 17:44   ` ppcfix.diff Jan Engelhardt
2004-11-29 18:12     ` ppcfix.diff Al Viro

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=20041129172252.GN26051@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=akpm@digeo.com \
    --cc=hugang@soulinfo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®