[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWt0qq-Umd8udb7fxpNVZ=X9O9eZGMVGFSGRO_d9UkgNw@mail.gmail.com>
Date: Wed, 29 Nov 2023 12:21:45 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Jonathan Neuschäfer <j.neuschaefer@....net>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Biju Das <biju.das.jz@...renesas.com>,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>,
Jianlong Huang <jianlong.huang@...rfivetech.com>,
linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
openbmc@...ts.ozlabs.org, linux-mips@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Dong Aisheng <aisheng.dong@....com>,
Fabio Estevam <festevam@...il.com>,
Shawn Guo <shawnguo@...nel.org>, Jacky Bai <ping.bai@....com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Sascha Hauer <s.hauer@...gutronix.de>,
NXP Linux Team <linux-imx@....com>,
Sean Wang <sean.wang@...nel.org>,
Paul Cercueil <paul@...pouillou.net>,
Lakshmi Sowjanya D <lakshmi.sowjanya.d@...el.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Emil Renner Berthing <kernel@...il.dk>,
Hal Feng <hal.feng@...rfivetech.com>
Subject: Re: [PATCH v3 06/22] pinctrl: core: Make pins const in struct group_desc
Hi Andy,
On Tue, Nov 28, 2023 at 9:04 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
> It's unclear why it's not a const from day 1. Make the pins member
> const in struct group_desc. Update necessary APIs.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Thanks for your patch!
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -642,7 +642,7 @@ static int pinctrl_generic_group_name_to_selector(struct pinctrl_dev *pctldev,
> * Note that the caller must take care of locking.
> */
> int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
> - int *pins, int num_pins, void *data)
> + const int *pins, int num_pins, void *data)
> {
> struct group_desc *group;
> int selector, error;
> diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
> index 530370443c19..01ea1ce99fe8 100644
> --- a/drivers/pinctrl/core.h
> +++ b/drivers/pinctrl/core.h
> @@ -203,7 +203,7 @@ struct pinctrl_maps {
> */
> struct group_desc {
> const char *name;
> - int *pins;
> + const int *pins;
> int num_pins;
> void *data;
> };
> @@ -222,7 +222,7 @@ struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev,
> unsigned int group_selector);
>
> 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".
The Renesas pinctrl drivers already pass arrays of unsigned ints.
Some other drivers still use arrays of ints, though.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-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
Powered by blists - more mailing lists