linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Brian Austin <brian.austin@cirrus.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Paul Handrigan <Paul.Handrigan@cirrus.com>,
	linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access
Date: Mon, 4 Jan 2016 15:20:58 +0000	[thread overview]
Message-ID: <20160104152058.GH19062@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <9222694.IRNnfpj6Tn@wuerfel>

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@lists.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.

  reply	other threads:[~2016-01-04 15:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-01 23:19 [PATCH] ASoC: cs35l32: avoid uninitialized variable access Arnd Bergmann
2016-01-02 14:17 ` Mark Brown
2016-01-04 15:17   ` Arnd Bergmann
2016-01-04 15:20     ` Russell King - ARM Linux [this message]
2016-01-04 16:41       ` Arnd Bergmann
2016-01-04 16:52         ` Russell King - ARM Linux
2016-01-04 15:45     ` Mark Brown
2016-03-07  4:19 Arnd Bergmann
2016-03-07 12:22 ` Austin, Brian

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=20160104152058.GH19062@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=arnd@arndb.de \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@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).