From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>, Julia Lawall <julia@diku.dk>,
"David S. Miller" <davem@davemloft.net>,
Andrew Morton <akpm@linux-foundation.org>,
uml-devel <user-mode-linux-devel@lists.sourceforge.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
Stephen Hemminger <shemminger@vyatta.com>
Subject: Re: {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: remove duplicate structure field initialization
Date: Tue, 28 Sep 2010 22:11:06 +0100 [thread overview]
Message-ID: <20100928211106.GE19804@ZenIV.linux.org.uk> (raw)
In-Reply-To: <AANLkTim85sH_2o=xCiDuoQrHq_7ZL96Y91xQMGxUP5Fy@mail.gmail.com>
On Tue, Sep 28, 2010 at 01:24:40PM -0700, Linus Torvalds wrote:
> It looks like that commit is indeed very misleading. The commit message says:
>
> "arch/um/drivers: remove duplicate structure field initialization"
>
> but it is in fact not duplicate: there's two field initializations,
> but they are _different_. Looking at the patch, it has:
>
> .ndo_set_mac_address = uml_net_set_mac,
> - .ndo_set_mac_address = eth_mac_addr,
>
> so it removes the later one, but it is not at all clear which one the
> compiler actually used. My guess is that it used to use the later one
> (the standard eth_mac_addr function), and the patch made it suddenly
> use the uml_net_set_mac function.
C99 6.7.8p19:
The initialization shall occur in initializer list order, each
initializer provided for a particular subobject overriding any previously
listed initializer for the same subobject[*]; all subobjects that are not
initialized explicitly shall be initialized implicitly the same as objects
that have static storage duration.
[*] Any initializer for subobject which is overridden and so not used to
initialize that subobject might not be evaluated at all.
IOW, it _must_ use the last one in such cases.
As for the driver, I smell an interface change (in eth_mac_addr() arguments)
that has been missed... FWIW, grep through the tree shows one more instance
of eth_mac_addr() called with such argument and it's also in net_kern.c; there
we simply want memcpy() instead, since device is definitely not running at
that point and we'd done the validity checks earlier.
Not sure if we need lp->lock around that eth_mac_addr() call - not familiar
with the driver in question. If we don't, we should switch to eth_mac_addr
for the method, indeed...
next prev parent reply other threads:[~2010-09-28 21:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-27 13:17 {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: remove duplicate structure field initialization Boaz Harrosh
2010-09-27 14:06 ` Phil Turmel
2010-09-28 20:24 ` [uml-devel] " Linus Torvalds
2010-09-28 20:24 ` Linus Torvalds
2010-09-28 20:47 ` [uml-devel] " Andrew Morton
2010-09-28 20:47 ` Andrew Morton
2010-09-28 20:51 ` David Miller
2010-09-28 20:57 ` [uml-devel] " Linus Torvalds
2010-09-28 20:57 ` Linus Torvalds
2010-09-28 21:00 ` [uml-devel] " David Miller
2010-09-28 21:00 ` David Miller
2010-09-28 21:08 ` Linus Torvalds
2010-09-29 8:34 ` [uml-devel] [PATCH] um: Proper Fix for f25c80a4: " Boaz Harrosh
2010-09-29 8:34 ` Boaz Harrosh
2010-09-29 15:05 ` Linus Torvalds
2010-09-30 2:28 ` [uml-devel] " David Miller
2010-09-30 2:28 ` David Miller
2010-09-29 8:41 ` {painfully BISECTED} Please revert f25c80a4b2: arch/um/drivers: " Boaz Harrosh
2010-09-29 15:01 ` Linus Torvalds
2010-09-30 2:27 ` David Miller
2010-09-28 21:11 ` Al Viro [this message]
2010-09-28 21:24 ` [uml-devel] " Al Viro
2010-09-28 21:24 ` Al Viro
2010-09-28 21:42 ` David Miller
2010-09-28 21:51 ` [uml-devel] " Al Viro
2010-09-28 21:51 ` Al Viro
2010-09-29 17:19 ` [uml-devel] " Renzo Davoli
2011-01-26 16:32 ` {painfullyBISECTED} " Emil Langrock
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=20100928211106.GE19804@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=bharrosh@panasas.com \
--cc=davem@davemloft.net \
--cc=julia@diku.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=torvalds@linux-foundation.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.