lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 1/8] gpio: aggregator: Stop using ARCH_NR_GPIOS
Hi Christophe,

On Mon, Aug 29, 2022 at 6:15 PM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
> ARCH_NR_GPIOS is used locally in aggr_parse() as the maximum number
> of GPIOs to be aggregated together by the driver since
> commit ec75039d5550 ("gpio: aggregator: Use bitmap_parselist() for
> parsing GPIO offsets").
>
> Don't rely on the total possible number of GPIOs in the system but
> define a local arbitrary macro for that, set to 512 which should be
> large enough as it is also the default value for ARCH_NR_GPIOS.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Thanks for your patch!

> --- a/drivers/gpio/gpio-aggregator.c
> +++ b/drivers/gpio/gpio-aggregator.c
> @@ -56,6 +56,8 @@ static int aggr_add_gpio(struct gpio_aggregator *aggr, const char *key,
> return 0;
> }
>
> +#define AGGREGATOR_MAX_GPIOS 512

I would insert this definition at the top, so it is not buried inside the code,
and easier to spot.

> +
> static int aggr_parse(struct gpio_aggregator *aggr)
> {
> char *args = skip_spaces(aggr->args);

The rest LGTM, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

\
 
 \ /
  Last update: 2022-08-30 09:52    [W:0.128 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site