Re: [PATCH] pinctrl: actions: Fix uninitialized error in owl_pin_config_set()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 08, 2018 at 12:05:47PM +0200, Geert Uytterhoeven wrote:
> 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: 2242ddfbf4d699b5 ("pinctrl: actions: Add Actions S900 pinctrl driver")
> Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> 

Thanks,
Mani
> ---
>  drivers/pinctrl/actions/pinctrl-owl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
> index 76243caa08c630c0..b5c880b50bb371f5 100644
> --- a/drivers/pinctrl/actions/pinctrl-owl.c
> +++ b/drivers/pinctrl/actions/pinctrl-owl.c
> @@ -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];
>  
> -- 
> 2.7.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux