lkml.org 
[lkml]   [2022]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/4] clk: actions: Terminate clk_div_table with sentinel element
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@gmx.net>
> > Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> > ---
[...]
> > 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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-02-05 13:59    [W:0.049 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site