* [PATCH 0/3] pinctrl: Use int type to store negative error codes
@ 2025-08-31 8:49 Qianfeng Rong
2025-08-31 8:49 ` [PATCH 3/3] pinctrl: renesas: " Qianfeng Rong
0 siblings, 1 reply; 5+ messages in thread
From: Qianfeng Rong @ 2025-08-31 8:49 UTC (permalink / raw)
To: Andrew Lunn, Gregory Clement, Sebastian Hesselbarth,
Linus Walleij, Jacky Huang, Shan-Chun Hung, Geert Uytterhoeven,
Bartosz Golaszewski,
moderated list:ARM/Marvell Kirkwood and Armada 370, 375, 38x,...,
open list:PIN CONTROL SUBSYSTEM, open list,
open list:PIN CONTROLLER - RENESAS
Cc: Qianfeng Rong
The 'ret' variable usually is used to store returns from some functions,
which return either zero on success or negative error codes on failure.
Storing the negative error codes in unsigned type, doesn't cause an issue
at runtime but can be confusing. Additionally, assigning negative error
codes to unsigned type may trigger a GCC warning when the -Wsign-conversion
flag is enabled.
Change "ret" from u32/unsigned int to int type. No effect on runtime.
Qianfeng Rong (3):
pinctrl: armada-37xx: Use int type to store negative error codes
pinctrl: ma35: Use int type to store negative error codes
pinctrl: renesas: Use int type to store negative error codes
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 6 ++++--
drivers/pinctrl/nuvoton/pinctrl-ma35.c | 3 ++-
drivers/pinctrl/renesas/pinctrl.c | 3 ++-
3 files changed, 8 insertions(+), 4 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] pinctrl: renesas: Use int type to store negative error codes
2025-08-31 8:49 [PATCH 0/3] pinctrl: Use int type to store negative error codes Qianfeng Rong
@ 2025-08-31 8:49 ` Qianfeng Rong
2025-09-01 9:07 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Qianfeng Rong @ 2025-08-31 8:49 UTC (permalink / raw)
To: Geert Uytterhoeven, Linus Walleij,
open list:PIN CONTROLLER - RENESAS,
open list:PIN CONTROL SUBSYSTEM, open list
Cc: Qianfeng Rong
Change the 'ret' variable in ma35_pinctrl_parse_functions() from unsigned
int to int, as it needs to store either negative error codes or zero
returned by sh_pfc_pinconf_set().
No effect on runtime.
Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
---
drivers/pinctrl/renesas/pinctrl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/renesas/pinctrl.c b/drivers/pinctrl/renesas/pinctrl.c
index 29d16c9c1bd1..3a742f74ecd1 100644
--- a/drivers/pinctrl/renesas/pinctrl.c
+++ b/drivers/pinctrl/renesas/pinctrl.c
@@ -726,7 +726,8 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
const unsigned int *pins;
unsigned int num_pins;
- unsigned int i, ret;
+ unsigned int i;
+ int ret;
pins = pmx->pfc->info->groups[group].pins;
num_pins = pmx->pfc->info->groups[group].nr_pins;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] pinctrl: renesas: Use int type to store negative error codes
2025-08-31 8:49 ` [PATCH 3/3] pinctrl: renesas: " Qianfeng Rong
@ 2025-09-01 9:07 ` Geert Uytterhoeven
2025-09-01 10:13 ` Qianfeng Rong
0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-09-01 9:07 UTC (permalink / raw)
To: Qianfeng Rong
Cc: Linus Walleij, open list:PIN CONTROLLER - RENESAS,
open list:PIN CONTROL SUBSYSTEM, open list
Hi Qianfeng,
Thanks for your patch!
On Sun, 31 Aug 2025 at 10:50, Qianfeng Rong <rongqianfeng@vivo.com> wrote:
> Change the 'ret' variable in ma35_pinctrl_parse_functions() from unsigned
sh_pfc_pinconf_group_set
> int to int, as it needs to store either negative error codes or zero
> returned by sh_pfc_pinconf_set().
>
> No effect on runtime.
Fortunately the issue was indeed harmless.
>
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Fixes: d0593c363f04ccc4 ("pinctrl: sh-pfc: Propagate errors on group config")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-pinctrl for v6.18, with the above fixed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] pinctrl: renesas: Use int type to store negative error codes
2025-09-01 9:07 ` Geert Uytterhoeven
@ 2025-09-01 10:13 ` Qianfeng Rong
2025-09-01 10:25 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: Qianfeng Rong @ 2025-09-01 10:13 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Walleij, open list:PIN CONTROLLER - RENESAS,
open list:PIN CONTROL SUBSYSTEM, open list
在 2025/9/1 17:07, Geert Uytterhoeven 写道:
> Hi Qianfeng,
>
> Thanks for your patch!
>
> On Sun, 31 Aug 2025 at 10:50, Qianfeng Rong <rongqianfeng@vivo.com> wrote:
>> Change the 'ret' variable in ma35_pinctrl_parse_functions() from unsigned
> sh_pfc_pinconf_group_set
Thank you for pointing out my mistake.
>
>> int to int, as it needs to store either negative error codes or zero
>> returned by sh_pfc_pinconf_set().
>>
>> No effect on runtime.
> Fortunately the issue was indeed harmless.
>
>> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> Fixes: d0593c363f04ccc4 ("pinctrl: sh-pfc: Propagate errors on group config")
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-pinctrl for v6.18, with the above fixed.
Will do in the next version.
>
> Gr{oetje,eeting}s,
>
> Geert
Best regards,
Qianfeng
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] pinctrl: renesas: Use int type to store negative error codes
2025-09-01 10:13 ` Qianfeng Rong
@ 2025-09-01 10:25 ` Geert Uytterhoeven
0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2025-09-01 10:25 UTC (permalink / raw)
To: Qianfeng Rong
Cc: Linus Walleij, open list:PIN CONTROLLER - RENESAS,
open list:PIN CONTROL SUBSYSTEM, open list
Hi Qianfeng,
On Mon, 1 Sept 2025 at 12:13, Qianfeng Rong <rongqianfeng@vivo.com> wrote:
> 在 2025/9/1 17:07, Geert Uytterhoeven 写道:
> > On Sun, 31 Aug 2025 at 10:50, Qianfeng Rong <rongqianfeng@vivo.com> wrote:
> >> Change the 'ret' variable in ma35_pinctrl_parse_functions() from unsigned
> > sh_pfc_pinconf_group_set
>
> Thank you for pointing out my mistake.
>
> >> int to int, as it needs to store either negative error codes or zero
> >> returned by sh_pfc_pinconf_set().
> >>
> >> No effect on runtime.
> > Fortunately the issue was indeed harmless.
> >
> >> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> > Fixes: d0593c363f04ccc4 ("pinctrl: sh-pfc: Propagate errors on group config")
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > i.e. will queue in renesas-pinctrl for v6.18, with the above fixed.
>
> Will do in the next version.
There is no need to resend; I will fix this up while applying.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-01 10:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-31 8:49 [PATCH 0/3] pinctrl: Use int type to store negative error codes Qianfeng Rong
2025-08-31 8:49 ` [PATCH 3/3] pinctrl: renesas: " Qianfeng Rong
2025-09-01 9:07 ` Geert Uytterhoeven
2025-09-01 10:13 ` Qianfeng Rong
2025-09-01 10:25 ` Geert Uytterhoeven
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).