[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170123151941.GG10895@lunn.ch>
Date: Mon, 23 Jan 2017 16:19:41 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Arnd Bergmann <arnd@...db.de>
Cc: Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Charles-Antoine Couret <charles-antoine.couret@...vision.fr>,
Clemens Gruber <clemens.gruber@...ruber.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] phy: marvell: remove conflicting initializer
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@...db.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@...n.ch>
Andrew
Powered by blists - more mailing lists