public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: rp1: silence uninitialized variable warning
@ 2025-06-30 19:35 Dan Carpenter
  2025-07-01  9:30 ` Andrea della Porta
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2025-06-30 19:35 UTC (permalink / raw)
  To: Andrea della Porta
  Cc: Linus Walleij, linux-gpio, linux-kernel, kernel-janitors

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@linaro.org>
---
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?

 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-01 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30 19:35 [PATCH] pinctrl: rp1: silence uninitialized variable warning Dan Carpenter
2025-07-01  9:30 ` Andrea della Porta
2025-07-01 19:04   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox