[PATCH v2] ata: Drop commas after OF match table sentinels

Geert Uytterhoeven geert at linux-m68k.org
Thu Mar 3 04:20:12 PST 2022


Hi Kieran,

On Thu, Mar 3, 2022 at 12:40 PM Kieran Bingham
<kieran.bingham at ideasonboard.com> wrote:
> Quoting Geert Uytterhoeven (2022-03-03 08:36:35)
> > It does not make sense to have a comma after a sentinel, as any new
> > elements must be added before the sentinel.
>
> Indeed.
>
> > Add comments to clarify the purpose of the empty elements.
> > Rewrap entries to a single line to have a consistent style.
>
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas at ideasonboard.com>

Thanks!

>
git grep "{ }," | wc -l
> 2638
> git grep "{}," | wc -l
> 2088
>
> Lots of false positives in that basic search, but this looks like a big
> job. Is this something that could be added to checkstyle?
>
> Probably hard to match when it's a sentinal, rather than an initialiser
> ... so perhaps a coccinelle task.

Yes, there are _lots_ of these.

I fixed the ca. 50 cases involving Renesas-specific compatible values,
and picked up the ata subsystem for a first run.  But fixing all of them
looks like a lot of work, so automation might help.

For soc_device_attribute tables, there are less cases, so I'll just
send the handful patches to fix all of them...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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



More information about the linux-arm-kernel mailing list