All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: brcmstb: pm-arm: Remove duplicate/repeating constant
@ 2023-02-11  8:38 ` Deepak R Varma
  0 siblings, 0 replies; 4+ messages in thread
From: Deepak R Varma @ 2023-02-11  8:38 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	linux-arm-kernel, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, Deepak R Varma

Constant DDR_PHY_RST_N is unnecessarily or'ed with itself. Remove
the redundant constant from the expression.
Issue identified using doublebitand.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Please note: I was unable to build the change though I had the appropriate
config, arch and  cross compiler. I used the following:
	.config = bmips_stb_defconfig
	ARCH=mips
	CROSS_COMPILE=/usr/bin/mips-linux-gnu-
	BRCMSTB_PM=y

Let me know what I missed so I can build the objects myself. Thank you.


 drivers/soc/bcm/brcmstb/pm/pm-arm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
index d681cd24c6e1..633e715446f7 100644
--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
+++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
@@ -288,7 +288,7 @@ static inline void s5entry_method1(void)
 		/* Step 3: Channel A (RST_N = CKE = 0) */
 		tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
 				  ctrl.phy_a_standby_ctrl_offs);
-		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
+		tmp &= ~DDR_PHY_RST_N;
 		writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
 			     ctrl.phy_a_standby_ctrl_offs);
 
@@ -296,7 +296,7 @@ static inline void s5entry_method1(void)
 		if (ctrl.phy_b_standby_ctrl_offs != DDR_PHY_NO_CHANNEL) {
 			tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
 					  ctrl.phy_b_standby_ctrl_offs);
-			tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
+			tmp &= ~DDR_PHY_RST_N;
 			writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
 				     ctrl.phy_b_standby_ctrl_offs);
 		}
-- 
2.34.1




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

* [PATCH] soc: brcmstb: pm-arm: Remove duplicate/repeating constant
@ 2023-02-11  8:38 ` Deepak R Varma
  0 siblings, 0 replies; 4+ messages in thread
From: Deepak R Varma @ 2023-02-11  8:38 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	linux-arm-kernel, linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar, Deepak R Varma

Constant DDR_PHY_RST_N is unnecessarily or'ed with itself. Remove
the redundant constant from the expression.
Issue identified using doublebitand.cocci Coccinelle semantic patch.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
Please note: I was unable to build the change though I had the appropriate
config, arch and  cross compiler. I used the following:
	.config = bmips_stb_defconfig
	ARCH=mips
	CROSS_COMPILE=/usr/bin/mips-linux-gnu-
	BRCMSTB_PM=y

Let me know what I missed so I can build the objects myself. Thank you.


 drivers/soc/bcm/brcmstb/pm/pm-arm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
index d681cd24c6e1..633e715446f7 100644
--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
+++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
@@ -288,7 +288,7 @@ static inline void s5entry_method1(void)
 		/* Step 3: Channel A (RST_N = CKE = 0) */
 		tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
 				  ctrl.phy_a_standby_ctrl_offs);
-		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
+		tmp &= ~DDR_PHY_RST_N;
 		writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
 			     ctrl.phy_a_standby_ctrl_offs);
 
@@ -296,7 +296,7 @@ static inline void s5entry_method1(void)
 		if (ctrl.phy_b_standby_ctrl_offs != DDR_PHY_NO_CHANNEL) {
 			tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
 					  ctrl.phy_b_standby_ctrl_offs);
-			tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
+			tmp &= ~DDR_PHY_RST_N;
 			writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
 				     ctrl.phy_b_standby_ctrl_offs);
 		}
-- 
2.34.1




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] soc: brcmstb: pm-arm: Remove duplicate/repeating constant
  2023-02-11  8:38 ` Deepak R Varma
@ 2023-02-11 14:55   ` Christophe JAILLET
  -1 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-02-11 14:55 UTC (permalink / raw)
  To: Deepak R Varma, Florian Fainelli,
	Broadcom internal kernel review list, linux-arm-kernel,
	linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar

Le 11/02/2023 à 09:38, Deepak R Varma a écrit :
> Constant DDR_PHY_RST_N is unnecessarily or'ed with itself. Remove
> the redundant constant from the expression.
> Issue identified using doublebitand.cocci Coccinelle semantic patch.
> 
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
> Please note: I was unable to build the change though I had the appropriate
> config, arch and  cross compiler. I used the following:
> 	.config = bmips_stb_defconfig
> 	ARCH=mips
> 	CROSS_COMPILE=/usr/bin/mips-linux-gnu-
> 	BRCMSTB_PM=y

The driver is pm-arm.c, try with arm instead of mips?

Worked for me with make.cross

> 
> Let me know what I missed so I can build the objects myself. Thank you.
> 
> 
>   drivers/soc/bcm/brcmstb/pm/pm-arm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> index d681cd24c6e1..633e715446f7 100644
> --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> @@ -288,7 +288,7 @@ static inline void s5entry_method1(void)
>   		/* Step 3: Channel A (RST_N = CKE = 0) */
>   		tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
>   				  ctrl.phy_a_standby_ctrl_offs);
> -		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
> +		tmp &= ~DDR_PHY_RST_N;

Based on step 3 comment above, maybe:

  -		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
  +		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_CKE);

?
>   		writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
>   			     ctrl.phy_a_standby_ctrl_offs);
>   
> @@ -296,7 +296,7 @@ static inline void s5entry_method1(void)
>   		if (ctrl.phy_b_standby_ctrl_offs != DDR_PHY_NO_CHANNEL) {
>   			tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
>   					  ctrl.phy_b_standby_ctrl_offs);
> -			tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
> +			tmp &= ~DDR_PHY_RST_N;

No such comment, but the code looks the same, so...

CJ

>   			writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
>   				     ctrl.phy_b_standby_ctrl_offs);
>   		}


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

* Re: [PATCH] soc: brcmstb: pm-arm: Remove duplicate/repeating constant
@ 2023-02-11 14:55   ` Christophe JAILLET
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-02-11 14:55 UTC (permalink / raw)
  To: Deepak R Varma, Florian Fainelli,
	Broadcom internal kernel review list, linux-arm-kernel,
	linux-kernel
  Cc: Saurabh Singh Sengar, Praveen Kumar

Le 11/02/2023 à 09:38, Deepak R Varma a écrit :
> Constant DDR_PHY_RST_N is unnecessarily or'ed with itself. Remove
> the redundant constant from the expression.
> Issue identified using doublebitand.cocci Coccinelle semantic patch.
> 
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
> Please note: I was unable to build the change though I had the appropriate
> config, arch and  cross compiler. I used the following:
> 	.config = bmips_stb_defconfig
> 	ARCH=mips
> 	CROSS_COMPILE=/usr/bin/mips-linux-gnu-
> 	BRCMSTB_PM=y

The driver is pm-arm.c, try with arm instead of mips?

Worked for me with make.cross

> 
> Let me know what I missed so I can build the objects myself. Thank you.
> 
> 
>   drivers/soc/bcm/brcmstb/pm/pm-arm.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> index d681cd24c6e1..633e715446f7 100644
> --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
> @@ -288,7 +288,7 @@ static inline void s5entry_method1(void)
>   		/* Step 3: Channel A (RST_N = CKE = 0) */
>   		tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
>   				  ctrl.phy_a_standby_ctrl_offs);
> -		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
> +		tmp &= ~DDR_PHY_RST_N;

Based on step 3 comment above, maybe:

  -		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
  +		tmp &= ~(DDR_PHY_RST_N | DDR_PHY_CKE);

?
>   		writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
>   			     ctrl.phy_a_standby_ctrl_offs);
>   
> @@ -296,7 +296,7 @@ static inline void s5entry_method1(void)
>   		if (ctrl.phy_b_standby_ctrl_offs != DDR_PHY_NO_CHANNEL) {
>   			tmp = readl_relaxed(ctrl.memcs[i].ddr_phy_base +
>   					  ctrl.phy_b_standby_ctrl_offs);
> -			tmp &= ~(DDR_PHY_RST_N | DDR_PHY_RST_N);
> +			tmp &= ~DDR_PHY_RST_N;

No such comment, but the code looks the same, so...

CJ

>   			writel_relaxed(tmp, ctrl.memcs[i].ddr_phy_base +
>   				     ctrl.phy_b_standby_ctrl_offs);
>   		}


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-02-11 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-11  8:38 [PATCH] soc: brcmstb: pm-arm: Remove duplicate/repeating constant Deepak R Varma
2023-02-11  8:38 ` Deepak R Varma
2023-02-11 14:55 ` Christophe JAILLET
2023-02-11 14:55   ` Christophe JAILLET

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.