Re: [PATCH 03/10] pinctrl: ingenic: Fix element type of x1600_sfc_funcs array

From: H. Nikolaus Schaller

Date: Tue Nov 03 2026 - 17:01:34 EST


Hi,

> Am 03.11.2026 um 22:29 schrieb Lee Jones <lee@xxxxxxxxxx>:
>
> ingenic_pinmux_set_mux() treats grp->data as a u8 array of per-pin mux
> modes (u8 *pin_modes = grp->data), and every other *_funcs array in the
> Ingenic pinctrl driver is declared as u8[]. Because x1600_sfc_funcs[]
> was declared as int[], indexing pin_modes[0..6] reads the first seven
> bytes of the int array (0, 0, 0, 0, 0, 0, 0) instead of reading mode 2
> for the seventh pin.
>
> Change the element type of x1600_sfc_funcs[] from int to u8.
>
> Fixes: 4da56f9c6f14 ("pinctrl: ingenic: add x1600 support")
> Closes: https://sashiko.dev/#/bug/linux-5dccd0ae-9450-440a-87d0-44cc86d1af45
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
> ---
> drivers/pinctrl/pinctrl-ingenic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
> index 1aa6a6dc1209..5c06208b8854 100644
> --- a/drivers/pinctrl/pinctrl-ingenic.c
> +++ b/drivers/pinctrl/pinctrl-ingenic.c
> @@ -2456,7 +2456,7 @@ static int x1600_mac_pins[] = {
> 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c,
> };
>
> -static int x1600_sfc_funcs[] = { 0, 0, 0, 0, 0, 0, 2, };
> +static u8 x1600_sfc_funcs[] = { 0, 0, 0, 0, 0, 0, 2, };

Yes, that appears to be the correct fix. All other INGENIC_PIN_GROUP_FUNCS()
use u8 arrays.

I can not test as our x1600 board does not use the SFC interface.

>
> static const struct group_desc x1600_groups[] = {
> INGENIC_PIN_GROUP("uart0-data", x1600_uart0_data, 0),
> --
> 2.56.0.385.gac671c819a-goog

Reviewed-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>