lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGOqmd5cvCeBjWMI@apocalypse>
Date: Tue, 1 Jul 2025 11:30:01 +0200
From: Andrea della Porta <andrea.porta@...e.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Andrea della Porta <andrea.porta@...e.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] pinctrl: rp1: silence uninitialized variable warning

Hi Dan,

On 14:35 Mon 30 Jun     , Dan Carpenter wrote:
> This default path could probably can't be reached but Smatch can't
> verify it so it complains that "arg" isn't initialized on this path.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>

Thanks for your patch!

> ---
> I didn't add a Fixes tag because this likely isn't a real bug.  Plus this
> code is very new so it doesn't need to be backported anyway.
> 
> Also checkpatch complains:
> 
> 	WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> 
> But I left it that way so it's consistent with the other return in
> the function.  Maybe we should change both?

We really can't get rid of that warning by replacing ENOTSUPP with
EOPNOTSUPP because the core pinctrl code still rely on the 'wrong'
define, like this excerpt from drivers/pinctrl/pinconf-generic.c:

...
	if (gname)
		ret = pin_config_group_get(dev_name(pctldev->dev),
					   gname, &config);
	else
		ret = pin_config_get_for_pin(pctldev, pin, &config);
	/* These are legal errors */
	if (ret == -EINVAL || ret == -ENOTSUPP)
		continue;
...

Also, many drivers still rely on ENOTSUPP. Maybe a patch that will
fix all of them at once (drivers and core code) is in order, I have
it in my todo list, indeed.
Besides that,

Reviewed-by: Andrea della Porta <andrea.porta@...e.com>

Many thanks,
Andrea

> 
>  drivers/pinctrl/pinctrl-rp1.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c
> index d300f28c52cd..f9cc6b28994c 100644
> --- a/drivers/pinctrl/pinctrl-rp1.c
> +++ b/drivers/pinctrl/pinctrl-rp1.c
> @@ -1524,6 +1524,8 @@ static int rp1_pinconf_get(struct pinctrl_dev *pctldev, unsigned int offset,
>  		case RP1_PAD_DRIVE_12MA:
>  			arg = 12;
>  			break;
> +		default:
> +			return -ENOTSUPP;
>  		}
>  		break;
>  	case PIN_CONFIG_BIAS_DISABLE:
> -- 
> 2.47.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ