[PATCH 2/4] gpio: zynqmp: Remove unused variable ret

Michal Simek michal.simek at amd.com
Fri Jan 6 13:42:10 CET 2023



On 1/6/23 13:00, Ashok Reddy Soma wrote:
> From: Algapally Santosh Sagar <santoshsagar.algapally at amd.com>
> 
> There is a unused variable ret, due to which we are getting sparse warning
> as below.
> warning: variable 'ret' set but not used [-Wunused-but-set-variable].
> 
> Remove variable ret.
> 
> Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally at amd.com>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma at amd.com>
> ---
> 
>   drivers/gpio/zynqmp_gpio_modepin.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/zynqmp_gpio_modepin.c b/drivers/gpio/zynqmp_gpio_modepin.c
> index 078fd83395..52eda9ceb4 100644
> --- a/drivers/gpio/zynqmp_gpio_modepin.c
> +++ b/drivers/gpio/zynqmp_gpio_modepin.c
> @@ -45,9 +45,8 @@ static int modepin_gpio_set_value(struct udevice *dev, unsigned int offset,
>   {
>   	u32 ret_payload[PAYLOAD_ARG_CNT];
>   	u32 out_val = 0;
> -	int ret;
>   
> -	ret = get_gpio_modepin(ret_payload);
> +	get_gpio_modepin(ret_payload);

:-) what about return error if get_gpio_modepin fails?

M

>   	if (value)
>   		out_val = OUTVAL(offset) | ret_payload[1];
>   	else


More information about the U-Boot mailing list