[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160104152058.GH19062@n2100.arm.linux.org.uk>
Date: Mon, 4 Jan 2016 15:20:58 +0000
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
Brian Austin <brian.austin@...rus.com>,
Liam Girdwood <lgirdwood@...il.com>,
Paul Handrigan <Paul.Handrigan@...rus.com>,
linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access
On Mon, Jan 04, 2016 at 04:17:47PM +0100, Arnd Bergmann wrote:
> On Saturday 02 January 2016 14:17:46 Mark Brown wrote:
> > On Sat, Jan 02, 2016 at 12:19:52AM +0100, Arnd Bergmann wrote:
> >
> > > - if (i2c_client->dev.of_node) {
> > > + if (IS_ENABLED(CONFIG_OF) && i2c_client->dev.of_node) {
> >
> > This would be a lot nicer if there was an __always_null annotation we
> > could put on of_node for !OF configurations, that'd Just Work and this
> > can't be the only case where we have this idiom.
> >
>
> How about an inline helper like
>
> static inline struct device_node *dev_of_node(struct device *dev)
> {
> if (IS_ENABLED(CONFIG_OF))
> return dev->of_node;
ITYM:
return IS_ENABLED(CONFIG_OF) ? dev->of_node : NULL;
or
if (IS_ENABLED(CONFIG_OF))
return dev->of_node;
else
return NULL;
> }
>
> Arnd
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists