* [PATCH v2] pinctrl: rzg2l: Variable may not have been assigned to
@ 2025-08-07 14:41 Andrew Goodbody
2025-09-01 19:15 ` Paul Barker
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Goodbody @ 2025-08-07 14:41 UTC (permalink / raw)
To: Nobuhiro Iwamatsu, Marek Vasut, Paul Barker, Tom Rini
Cc: u-boot, Andrew Goodbody
In rzg2l_pinconf_set and rzg2l_get_pin_muxing if the call to
rzg2l_selector_decode fails then the variable pin may not have been
assigned to. Remove the use of pin from the error message. Also update
the error message to show the invalid selector used instead of port
which will be the error code returned.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
---
Changes in v2:
- Replace port in the error message with the selector used that is wrong
- Link to v1: https://lore.kernel.org/r/20250807-pinctrl_renesas-v1-1-055ace62c1dc@linaro.org
---
drivers/pinctrl/renesas/rzg2l-pfc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/renesas/rzg2l-pfc.c b/drivers/pinctrl/renesas/rzg2l-pfc.c
index 3c751e9473a..4a75e0b2372 100644
--- a/drivers/pinctrl/renesas/rzg2l-pfc.c
+++ b/drivers/pinctrl/renesas/rzg2l-pfc.c
@@ -353,7 +353,7 @@ static int rzg2l_pinconf_set(struct udevice *dev, unsigned int pin_selector,
/* The pin selector refers to a multiplexed pin */
int port = rzg2l_selector_decode(data, pin_selector, &pin);
if (port < 0) {
- dev_err(dev, "Invalid pin selector %u:%u\n", port, pin);
+ dev_err(dev, "Invalid pin selector %u\n", pin_selector);
return port;
}
@@ -550,7 +550,7 @@ static int rzg2l_get_pin_muxing(struct udevice *dev, unsigned int selector,
port = rzg2l_selector_decode(data, selector, &pin);
if (port < 0) {
- dev_err(dev, "Invalid pin selector %u:%u\n", port, pin);
+ dev_err(dev, "Invalid pin selector %u\n", selector);
return port;
}
---
base-commit: 3526f990b77fca1c933f1d8b24eb9385010a05bf
change-id: 20250807-pinctrl_renesas-b48818ef01b3
Best regards,
--
Andrew Goodbody <andrew.goodbody@linaro.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pinctrl: rzg2l: Variable may not have been assigned to
2025-08-07 14:41 [PATCH v2] pinctrl: rzg2l: Variable may not have been assigned to Andrew Goodbody
@ 2025-09-01 19:15 ` Paul Barker
2025-09-02 22:10 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Paul Barker @ 2025-09-01 19:15 UTC (permalink / raw)
To: Andrew Goodbody, Nobuhiro Iwamatsu, Marek Vasut, Tom Rini; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
On Thu, 2025-08-07 at 15:41 +0100, Andrew Goodbody wrote:
> In rzg2l_pinconf_set and rzg2l_get_pin_muxing if the call to
> rzg2l_selector_decode fails then the variable pin may not have been
> assigned to. Remove the use of pin from the error message. Also update
> the error message to show the invalid selector used instead of port
> which will be the error code returned.
>
> This issue was found by Smatch.
>
> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This fell off my radar, sorry!
Reviewed-by: Paul Barker <paul@pbarker.dev>
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] pinctrl: rzg2l: Variable may not have been assigned to
2025-09-01 19:15 ` Paul Barker
@ 2025-09-02 22:10 ` Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2025-09-02 22:10 UTC (permalink / raw)
To: Paul Barker, Andrew Goodbody, Nobuhiro Iwamatsu, Marek Vasut,
Tom Rini
Cc: u-boot
On 9/1/25 9:15 PM, Paul Barker wrote:
> On Thu, 2025-08-07 at 15:41 +0100, Andrew Goodbody wrote:
>> In rzg2l_pinconf_set and rzg2l_get_pin_muxing if the call to
>> rzg2l_selector_decode fails then the variable pin may not have been
>> assigned to. Remove the use of pin from the error message. Also update
>> the error message to show the invalid selector used instead of port
>> which will be the error code returned.
>>
>> This issue was found by Smatch.
>>
>> Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
>
> This fell off my radar, sorry!
>
> Reviewed-by: Paul Barker <paul@pbarker.dev>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Thanks !
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-02 22:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 14:41 [PATCH v2] pinctrl: rzg2l: Variable may not have been assigned to Andrew Goodbody
2025-09-01 19:15 ` Paul Barker
2025-09-02 22:10 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).