Skip to content

Commit

Permalink
pinctrl: actions: Fix uninitialized error in owl_pin_config_set()
Browse files Browse the repository at this point in the history
With gcc 4.1.2:

    drivers/pinctrl/actions/pinctrl-owl.c: In function ‘owl_pin_config_set’:
    drivers/pinctrl/actions/pinctrl-owl.c:336: warning: ‘ret’ may be used uninitialized in this function

Indeed, if num_configs is zero, the uninitialized value will be returned
as an error code.

Fix this by preinitializing it to zero.

Fixes: 2242ddf ("pinctrl: actions: Add Actions S900 pinctrl driver")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
geertu authored and linusw committed Jun 18, 2018
1 parent 7f57871 commit 71fd5d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pinctrl/actions/pinctrl-owl.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ static int owl_pin_config_set(struct pinctrl_dev *pctrldev,
unsigned long flags;
unsigned int param;
u32 reg, bit, width, arg;
int ret, i;
int ret = 0, i;

info = &pctrl->soc->padinfo[pin];

Expand Down

0 comments on commit 71fd5d0

Please sign in to comment.