pinctrl: amd: avoid maybe-uninitalized warning
commit581d3c2025632f838fb08e5160dab752b3a1f527
authorArnd Bergmann <arnd@arndb.de>
Wed, 11 Jan 2017 14:36:56 +0000 (11 15:36 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 12 Jan 2017 07:49:12 +0000 (12 08:49 +0100)
tree6bea3a20d7a06bd46e97e2dea7a528b434a85380
parent49c03096263871a68c9dea3e86b7d1e163d2fba8
pinctrl: amd: avoid maybe-uninitalized warning

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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c