[PATCH 1/1] clk: sifive: avoid declaring static variables in includes

Leo Liang ycliang at andestech.com
Mon Sep 9 07:47:00 CEST 2024


On Sat, Feb 17, 2024 at 12:18:04AM +0100, Heinrich Schuchardt wrote:
> The existing code is unnecessarily convoluted:
> 
> Arrays __prci_init_clocks_fu[5|7]40  are initialized with data.
> In separate includes fu[5|7]40-prci.h the size of the arrays is provided as
> constants.
> 
> By moving the structures prci_clk_fu[5|7]40 to the respective code modules
> we can directly use ARRAY_SIZE() to access the size of the data used for
> initialization.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  drivers/clk/sifive/fu540-prci.c  |  7 ++++++-
>  drivers/clk/sifive/fu540-prci.h  | 22 ----------------------
>  drivers/clk/sifive/fu740-prci.c  |  7 ++++++-
>  drivers/clk/sifive/fu740-prci.h  | 22 ----------------------
>  drivers/clk/sifive/sifive-prci.c |  3 +--
>  drivers/clk/sifive/sifive-prci.h |  4 ++++
>  6 files changed, 17 insertions(+), 48 deletions(-)
>  delete mode 100644 drivers/clk/sifive/fu540-prci.h
>  delete mode 100644 drivers/clk/sifive/fu740-prci.h

Reviewed-by: Leo Yu-Chi Liang <ycliang at andestech.com>


More information about the U-Boot mailing list