Thread (32 messages) 32 messages, 3 authors, 2023-11-29

Re: [PATCH v3 06/22] pinctrl: core: Make pins const in struct group_desc

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2023-11-29 15:34:35
Also in: linux-arm-msm, linux-gpio, linux-mediatek, linux-mips, linux-renesas-soc, lkml

Hi Andy,

On Wed, Nov 29, 2023 at 3:23 PM Andy Shevchenko
[off-list ref] wrote:
On Wed, Nov 29, 2023 at 03:41:55PM +0200, Andy Shevchenko wrote:
quoted
On Wed, Nov 29, 2023 at 12:21:45PM +0100, Geert Uytterhoeven wrote:
quoted
On Tue, Nov 28, 2023 at 9:04 PM Andy Shevchenko
[off-list ref] wrote:
quoted
It's unclear why it's not a const from day 1. Make the pins member
const in struct group_desc. Update necessary APIs.
...
quoted
quoted
quoted
 int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
-                             int *gpins, int ngpins, void *data);
+                             const int *pins, int num_pins, void *data);

 int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev,
                                 unsigned int group_selector);
Probably this is also the right moment to change all of these to arrays
of unsigned ints?  Else you will have mixed int/unsigned int after
"[PATCH v3 13/22] pinctrl: core: Embed struct pingroup into struct
group_desc", and purely unsigned int after "[PATCH v3 22/22] pinctrl:
core: Remove unused members from struct group_desc".
Hmm... Can it be done later?

I can, of course try to change the parameter here to be unsigned, but it most
likely fail the build for those drivers means need more patches, more delay to
this series.

Linus?
On the first glance updating API here does not fail the build.
That's what I had expected, as drivers already pass int or unsigned int
arrays anyway.
Lemme incorporate this into v4.
Thanks!
Meanwhile the drivers I left untouched, it might be separate changes
to convert from int to const unsigned int.
Sounds fine to me.

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help