Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557159

Re: [PATCH] pinctrl: amd: avoid maybe-uninitalized warning

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] pinctrl: amd: avoid maybe-uninitalized warning
Date 2017-01-12 09:00 +0100
Message-ID <sYIsF-1h1-9@gated-at.bofh.it> (permalink)
References <sYsee-82P-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jan 11, 2017 at 3:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> Since gpio_dev->hwbank_num is now a variable, the compiler cannot
> figure out if pin_num is initialized at all:
>
> drivers/pinctrl/pinctrl-amd.c: In function 'amd_gpio_dbg_show':
> drivers/pinctrl/pinctrl-amd.c:210:3: warning: 'pin_num' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    for (; i < pin_num; i++) {
>    ^~~
> drivers/pinctrl/pinctrl-amd.c:172:21: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> This adds a 'default' statement to make that case well-defined.
>
> Fixes: 3bfd44306c65 ("pinctrl: amd: Add support for additional GPIO")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied.

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] pinctrl: amd: avoid maybe-uninitalized warning Arnd Bergmann <arnd@arndb.de> - 2017-01-11 15:40 +0100
  Re: [PATCH] pinctrl: amd: avoid maybe-uninitalized warning Linus Walleij <linus.walleij@linaro.org> - 2017-01-12 09:00 +0100

csiph-web