[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160104154511.GL16023@sirena.org.uk>
Date: Mon, 4 Jan 2016 15:45:11 +0000
From: Mark Brown <broonie@...nel.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: linux-arm-kernel@...ts.infradead.org,
Brian Austin <brian.austin@...rus.com>,
Liam Girdwood <lgirdwood@...il.com>,
Paul Handrigan <Paul.Handrigan@...rus.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.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:
> > 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;
> }
Yeah, that'd work as well (with the correction Russell mentioned) - it's
a bit more typing but we already do similar things for the ID tables and
it looks nicer than the IS_ENABLED() in code does.
Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)
Powered by blists - more mailing lists