[PATCH RFT V2 2/8] clk: fractional-divider: add explicit big endian support

Stephen Boyd sboyd at kernel.org
Thu Apr 18 09:30:53 AEST 2019


Quoting Jonas Gorski (2019-04-15 03:10:40)
> diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c
> index fdfe2e423d15..b9988d3b3828 100644
> --- a/drivers/clk/clk-fractional-divider.c
> +++ b/drivers/clk/clk-fractional-divider.c
> @@ -13,6 +13,22 @@
>  #include <linux/slab.h>
>  #include <linux/rational.h>
>  
> +static inline u32 clk_fd_readl(struct clk_fractional_divider *fd)
> +{
> +       if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN)
> +               return ioread32be(fd->reg);
> +       else
> +               return clk_readl(fd->reg);

Can you write it without the else?

       if (fd->flags & CLK_FRAC_DIVIDER_BIG_ENDIAN)
               return ioread32be(fd->reg);

       return clk_readl(fd->reg);

This same comment applies to all the basic clk types.



More information about the Linuxppc-dev mailing list