Devicetree
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Brian Austin
	<brian.austin-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org>,
	Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Paul Handrigan
	<Paul.Handrigan-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ASoC: cs35l32: avoid uninitialized variable access
Date: Mon, 04 Jan 2016 16:17:47 +0100	[thread overview]
Message-ID: <9222694.IRNnfpj6Tn@wuerfel> (raw)
In-Reply-To: <20160102141746.GH16023-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

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;	
}

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2884997.s8B8BuE04L@wuerfel>
     [not found] ` <20160102141746.GH16023@sirena.org.uk>
     [not found]   ` <20160102141746.GH16023-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-01-04 15:17     ` Arnd Bergmann [this message]
2016-01-04 15:20       ` [PATCH] ASoC: cs35l32: avoid uninitialized variable access Russell King - ARM Linux
     [not found]         ` <20160104152058.GH19062-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2016-01-04 16:41           ` Arnd Bergmann
2016-01-04 16:52             ` Russell King - ARM Linux
2016-01-04 15:45       ` Mark Brown

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=9222694.IRNnfpj6Tn@wuerfel \
    --to=arnd-r2ngtmty4d4@public.gmane.org \
    --cc=Paul.Handrigan-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org \
    --cc=brian.austin-jGc1dHjMKG3QT0dZR+AlfA@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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