All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: usb: Fix misuse of IS_ENABLED
@ 2021-04-27  7:17 Chen Li
  2021-04-30 15:05 ` Alan Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chen Li @ 2021-04-27  7:17 UTC (permalink / raw)
  To: Al Cooper, Kishon Vijay Abraham I, Vinod Koul, linux-phy,
	bcm-kernel-feedback-list


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@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




-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: usb: Fix misuse of IS_ENABLED
  2021-04-27  7:17 [PATCH] phy: usb: Fix misuse of IS_ENABLED Chen Li
@ 2021-04-30 15:05 ` Alan Cooper
  2021-05-02 15:53 ` Florian Fainelli
  2021-05-14 12:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Alan Cooper @ 2021-04-30 15:05 UTC (permalink / raw)
  To: Chen Li
  Cc: Kishon Vijay Abraham I, Vinod Koul, linux-phy, BCM Kernel Feedback

On Tue, Apr 27, 2021 at 3:18 AM Chen Li <chenli@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@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@gmail.com>

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: usb: Fix misuse of IS_ENABLED
  2021-04-27  7:17 [PATCH] phy: usb: Fix misuse of IS_ENABLED Chen Li
  2021-04-30 15:05 ` Alan Cooper
@ 2021-05-02 15:53 ` Florian Fainelli
  2021-05-14 12:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-05-02 15:53 UTC (permalink / raw)
  To: Chen Li, Al Cooper, Kishon Vijay Abraham I, Vinod Koul,
	linux-phy, bcm-kernel-feedback-list



On 4/27/2021 12:17 AM, Chen Li 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@uniontech.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Fixes: 94583a41047e ("phy: usb: Restructure in preparation for adding
7216 USB support")
-- 
Florian

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] phy: usb: Fix misuse of IS_ENABLED
  2021-04-27  7:17 [PATCH] phy: usb: Fix misuse of IS_ENABLED Chen Li
  2021-04-30 15:05 ` Alan Cooper
  2021-05-02 15:53 ` Florian Fainelli
@ 2021-05-14 12:11 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2021-05-14 12:11 UTC (permalink / raw)
  To: Chen Li
  Cc: Al Cooper, Kishon Vijay Abraham I, linux-phy, bcm-kernel-feedback-list

On 27-04-21, 15:17, Chen Li 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.

Applied, thanks

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-14 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27  7:17 [PATCH] phy: usb: Fix misuse of IS_ENABLED Chen Li
2021-04-30 15:05 ` Alan Cooper
2021-05-02 15:53 ` Florian Fainelli
2021-05-14 12:11 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.