[PATCH] phy: usb: Fix misuse of IS_ENABLED
Alan Cooper
alcooperx at gmail.com
Fri Apr 30 16:05:48 BST 2021
On Tue, Apr 27, 2021 at 3:18 AM Chen Li <chenli at uniontech.com> wrote:
>
>
> While IS_ENABLED() is perfectly fine for CONFIG_* symbols, it is not
> for other symbols such as __BIG_ENDIAN that is provided directly by
> the compiler.
>
> Switch to use CONFIG_CPU_BIG_ENDIAN instead of __BIG_ENDIAN.
>
> Signed-off-by: Chen Li <chenli at uniontech.com>
> ---
> drivers/phy/broadcom/phy-brcm-usb-init.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/broadcom/phy-brcm-usb-init.h b/drivers/phy/broadcom/phy-brcm-usb-init.h
> index 899b9eb43fad..a39f30fa2e99 100644
> --- a/drivers/phy/broadcom/phy-brcm-usb-init.h
> +++ b/drivers/phy/broadcom/phy-brcm-usb-init.h
> @@ -78,7 +78,7 @@ static inline u32 brcm_usb_readl(void __iomem *addr)
> * Other architectures (e.g., ARM) either do not support big endian, or
> * else leave I/O in little endian mode.
> */
> - if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN))
> + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
> return __raw_readl(addr);
> else
> return readl_relaxed(addr);
> @@ -87,7 +87,7 @@ static inline u32 brcm_usb_readl(void __iomem *addr)
> static inline void brcm_usb_writel(u32 val, void __iomem *addr)
> {
> /* See brcmnand_readl() comments */
> - if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN))
> + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
> __raw_writel(val, addr);
> else
> writel_relaxed(val, addr);
> --
> 2.31.1
>
>
Reviewed-by: Al Cooper <alcooperx at gmail.com>
More information about the linux-phy
mailing list