Re: [PATCH v3 1/4] clk: actions: Terminate clk_div_table with sentinel element

From: Jonathan Neuschäfer
Date: Sat Feb 05 2022 - 07:59:08 EST


On Sat, Feb 05, 2022 at 01:15:46PM +0100, Philippe Mathieu-Daudé wrote:
> On 5/2/22 01:52, Jonathan Neuschäfer wrote:
> > In order that the end of a clk_div_table can be detected, it must be
> > terminated with a sentinel element (.div = 0).
> >
> > In owl-s900.s, the { 0, 8 } element was probably meant to be just that,
> > so this patch changes { 0, 8 } to { 0, 0 }.
> >
> > Fixes: d47317ca4ade1 ("clk: actions: Add S700 SoC clock support")
> > Fixes: d85d20053e195 ("clk: actions: Add S900 SoC clock support")
> > Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
> > Reviewed-by: Manivannan Sadhasivam <mani@xxxxxxxxxx>
> > ---
[...]
> > static struct clk_div_table rmii_div_table[] = {
> > {0, 4}, {1, 10},
> > + {0, 0},
>
> Again, clearer to use:
>
> { /* sentinel */ }
>
> (without the trailing comma, to enforce this is the last entry).

This style is locally consistent in the file, so anyone who reads the
file will encounter { 0, 0 } elements anyway.

So, I think it makes sense to:

- Keep this patch as is (except for the trailing comma, I'll remove that)
- Add a second patch that replaces all the sentinel elements with
{ /* sentinel */ }

This patch can go into stable branches, and the style cleanup doesn't
have to.


Best regards,
Jonathan

Attachment: signature.asc
Description: PGP signature