Re: [PATCH v1 2/2] gpio: aggregator: Replace custom get_arg() with a generic next_arg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Mon, Mar 1, 2021 at 5:59 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> cmdline library provides next_arg() helper to traverse over parameters
> and their values given in command line. Replace custom approach in the driver
> by it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/gpio/gpio-aggregator.c
> +++ b/drivers/gpio/gpio-aggregator.c
> @@ -93,13 +68,9 @@ static int aggr_parse(struct gpio_aggregator *aggr)
>         if (!bitmap)
>                 return -ENOMEM;
>
> -       for (name = get_arg(&args), offsets = get_arg(&args); name;
> -            offsets = get_arg(&args)) {
> -               if (IS_ERR(name)) {
> -                       pr_err("Cannot get GPIO specifier: %pe\n", name);
> -                       error = PTR_ERR(name);
> -                       goto free_bitmap;
> -               }
> +       args = next_arg(args, &name, &p);
> +       while (*args) {
> +               args = next_arg(args, &offsets, &p);

As name and offsets should not contain equal signs (can they?),
I guess using next_arg() is fine.

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux