netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>,
	Clemens Gruber <clemens.gruber@pqgruber.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: marvell: remove conflicting initializer
Date: Mon, 23 Jan 2017 16:19:41 +0100	[thread overview]
Message-ID: <20170123151941.GG10895@lunn.ch> (raw)
In-Reply-To: <20170123121905.3245589-1-arnd@arndb.de>

On Mon, Jan 23, 2017 at 01:18:41PM +0100, Arnd Bergmann wrote:
> One line was apparently pasted incorrectly during a new feature patch:
> 
> drivers/net/phy/marvell.c:2090:15: error: initialized field overwritten [-Werror=override-init]
>    .features = PHY_GBIT_FEATURES,
> 
> I'm removing the extraneous line here to avoid the W=1 warning and restore
> the previous flags value, and I'm slightly reordering the lines for consistency
> to make it less likely to happen again in the future. The ordering in the
> array is still not the same as in the structure definition, instead I picked
> the order that is most common in this file and that seems to make more sense
> here.
> 
> Fixes: 0b04680fdae4 ("phy: marvell: Add support for temperature sensor")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Hi Arnd

Thanks for this. I found one bug in my code while testing due to
duplicate probe initialisation. I was surprised at the time the
compiler did not warn me. I didn't think to try W=1. Is there any
legitimate need to allow multiple initialisation of a field? Can this
warning be made always on instead of only W=1?

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

  reply	other threads:[~2017-01-23 15:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 12:18 [PATCH] phy: marvell: remove conflicting initializer Arnd Bergmann
2017-01-23 15:19 ` Andrew Lunn [this message]
2017-01-23 16:09   ` Arnd Bergmann
2017-01-23 16:28     ` Andrew Lunn
2017-01-24 19:09 ` David Miller

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=20170123151941.GG10895@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=charles-antoine.couret@nexvision.fr \
    --cc=clemens.gruber@pqgruber.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).