On Wed, Mar 1, 2023 at 10:56 PM Ralph Siemsen <ralph.siemsen@xxxxxxxxxx> wrote: > Each entry in the clock table specifies a number of individual bits in > registers, for contolling clock reset, gaiting, etc. These reg/bit were > packed into a u16 to save space. The combined value is difficult to > understand when reviewing the clock table entries. > > Introduce a "struct regbit" which still occupies only 16 bits, but > allows the register and bit values to be specified explicitly. Convert > all previous uses of u16 for reg/bit into "struct regbit". > > The bulk of this patch converts the clock table to use struct regbit, > making use of the RB() helper macro. The conversion was automated by > script, and as a further verification, the compiled binary of the table > was compared before/after the change (with objdump -D). > > The clk_rdesc_set() function now checks for zero reg/bit internally. > This allows callers of that function to remove those checks. > > Signed-off-by: Ralph Siemsen <ralph.siemsen@xxxxxxxxxx> > --- > > Changes in v2: > - Replace register shifts with multiply/divide > - Unify the reg access in clk_rdesc_{get,set} > - Restore the WARN_ON() check for clock gate > - Swap field order in struct regbit, to exactly match the u16 values Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> i.e. will queue in renesas-clk-for-v6.4. 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