From: Linus Walleij <linus.walleij@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [PATCH] gpiolib: always initialize *flags from of_get_named_gpio_flags
Date: Mon, 4 Jan 2016 08:49:30 +0100 [thread overview]
Message-ID: <CACRpkdZpax1RKu44nR9qbDjDj32cJpSCvTcdjSknmWVbRSxN3g@mail.gmail.com> (raw)
In-Reply-To: <6037371.CvRA1dDj1l@wuerfel>
On Fri, Jan 1, 2016 at 11:40 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The of_get_named_gpio_flags() function does nothing other than returning
> an error when CONFIG_OF_GPIO is disabled, but that causes spurious
> warnings about possible use of uninitialized variables in any code that
> does not check the of_get_named_gpio_flags() return value before trying
> to use the flags:
>
> drivers/input/misc/rotary_encoder.c: In function 'rotary_encoder_probe':
> drivers/input/misc/rotary_encoder.c:223:28: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/power/bq24735-charger.c: In function 'bq24735_charger_probe':
> drivers/power/bq24735-charger.c:227:12: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
> drivers/power/sbs-battery.c: In function 'sbs_probe':
> drivers/power/sbs-battery.c:782:17: warning: 'gpio_flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> This changes the behavior of the inline helper to set the flags to zero
> when OF_GPIO is disabled, to avoid the warnings. In all cases I've
> encountered, we don't actually get to the place that uses the flags
> if CONFIG_OF is disabled because we won't enter the DT parser code.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Patch applied!
Yours,
Linus Walleij
prev parent reply other threads:[~2016-01-04 7:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-01 22:40 [PATCH] gpiolib: always initialize *flags from of_get_named_gpio_flags Arnd Bergmann
2016-01-04 7:49 ` Linus Walleij [this message]
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=CACRpkdZpax1RKu44nR9qbDjDj32cJpSCvTcdjSknmWVbRSxN3g@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.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).