Skip to contentSkip to conversation

OMAP4: clockdomain: Use logical OR instead of bitwise OR

PATCH In review Rajendra Nayak 2 participants 3 messages Feb 26, 2010 – Mar 1, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP4: clockdomain: Use logical OR instead of bitwise OR

This patch fixes usage of bitwise OR in if conditions, and instead uses logical OR.

---

Patch generated on top of for_2.6.34_b branch from
git://git.pwsan.com/linux-2.6 tree.

 arch/arm/mach-omap2/clockdomain.c |    4 ++--
 arch/arm/mach-omap2/powerdomain.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/clockdomain.c +2 -2
index b87ad66..be846e6 100644
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
 		cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
 			    clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
 			 __ffs(clkdm->clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
 		cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
 			      clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
 			 __ffs(clkdm->clktrctrl_mask));
arch/arm/mach-omap2/powerdomain.c +1 -1
index 9a0fb38..ebfce7d 100644
@@ -222,7 +222,7 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
 {
 	struct powerdomain **p = NULL;
 
-	if (cpu_is_omap24xx() | cpu_is_omap34xx()) {
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL;
 		pwrstst_reg_offs = OMAP2_PM_PWSTST;
 	} else if (cpu_is_omap44xx()) {
Signature · 1 line
1.5.4.7
maintainer
#1 lore raw
Quoted 2 lines · Rajendra Nayak

This patch fixes usage of bitwise OR in if conditions, and instead uses logical OR.

Great, can you please check and update this for other similar errors:

$ grep -r ") | cpu" .
./mach-omap2/prcm.c:    if (cpu_is_omap24xx() | cpu_is_omap34xx())
./mach-omap2/prcm.c:    if (cpu_is_omap24xx() | cpu_is_omap34xx())
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
./mach-omap2/powerdomain.c:     if (cpu_is_omap24xx() | cpu_is_omap34xx()) {

Regards,

Tony

Quoted 53 lines

---

Patch generated on top of for_2.6.34_b branch from
git://git.pwsan.com/linux-2.6 tree.

 arch/arm/mach-omap2/clockdomain.c |    4 ++--
 arch/arm/mach-omap2/powerdomain.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/clockdomain.c +2 -2
index b87ad66..be846e6 100644
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
 		cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
 			    clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
 			 __ffs(clkdm->clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)
 		cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
 			      clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL);
 
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
 			 __ffs(clkdm->clktrctrl_mask));
arch/arm/mach-omap2/powerdomain.c +1 -1
index 9a0fb38..ebfce7d 100644
@@ -222,7 +222,7 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
 {
 	struct powerdomain **p = NULL;
 
-	if (cpu_is_omap24xx() | cpu_is_omap34xx()) {
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL;
 		pwrstst_reg_offs = OMAP2_PM_PWSTST;
 	} else if (cpu_is_omap44xx()) {
Signature · 6 lines
1.5.4.7

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Saturday, February 27, 2010 6:12 AM
To: Nayak, Rajendra
Cc: [email protected]; [email protected]; Pagare, Abhijit
Subject: Re: [PATCH] OMAP4: clockdomain: Use logical OR instead of bitwise OR

Quoted 5 lines
Quoted 2 lines · Rajendra Nayak

This patch fixes usage of bitwise OR in if conditions, and instead uses logical OR.

Great, can you please check and update this for other similar errors:

ok.. updated patch on the way.

Quoted 78 lines
$ grep -r ") | cpu" .
./mach-omap2/prcm.c:    if (cpu_is_omap24xx() | cpu_is_omap34xx())
./mach-omap2/prcm.c:    if (cpu_is_omap24xx() | cpu_is_omap34xx())
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() 
| cpu_is_omap44xx()) {
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() 
| cpu_is_omap44xx()) {
./mach-omap2/clockdomain.c:     } else if (cpu_is_omap34xx() 
| cpu_is_omap44xx()) {
./mach-omap2/powerdomain.c:     if (cpu_is_omap24xx() | 
cpu_is_omap34xx()) {

Regards,

Tony

Quoted 4 lines

---

Review

Quoted 8 lines

Patch generated on top of for_2.6.34_b branch from
git://git.pwsan.com/linux-2.6 tree.

 arch/arm/mach-omap2/clockdomain.c |    4 ++--
 arch/arm/mach-omap2/powerdomain.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-omap2/clockdomain.c

arch/arm/mach-omap2/clockdomain.c int omap2_clkdm_sleep(struct clockdomain *clkdm) · line 813

Quoted 6 lines

index b87ad66..be846e6 100644

arch/arm/mach-omap2/clockdomain.c +0 -0
@@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)
 		cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
 			    clkdm->pwrdm.ptr->prcm_offs, 

OMAP2_PM_PWSTCTRL);

arch/arm/mach-omap2/clockdomain.c int omap2_clkdm_wakeup(struct

Quoted 7 lines
arch/arm/mach-omap2/clockdomain.c +1 -1
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
 			 __ffs(clkdm->clktrctrl_mask));
@@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct 

clockdomain *clkdm)

arch/arm/mach-omap2/clockdomain.c int omap2_clkdm_wakeup(struct · line 857

Quoted 2 lines
arch/arm/mach-omap2/clockdomain.c +0 -0
 		cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
 			      clkdm->pwrdm.ptr->prcm_offs, 

OMAP2_PM_PWSTCTRL);

Review

Quoted 7 lines
arch/arm/mach-omap2/clockdomain.c +1 -1
-	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) {
+	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 
 		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
 			 __ffs(clkdm->clktrctrl_mask));
(quoted diff) +0 -0

b/arch/arm/mach-omap2/powerdomain.c

Quoted 17 lines

index 9a0fb38..ebfce7d 100644

arch/arm/mach-omap2/powerdomain.c +1 -1
@@ -222,7 +222,7 @@ void pwrdm_init(struct powerdomain **pwrdm_list)
 {
 	struct powerdomain **p = NULL;
 
-	if (cpu_is_omap24xx() | cpu_is_omap34xx()) {
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL;
 		pwrstst_reg_offs = OMAP2_PM_PWSTST;
 	} else if (cpu_is_omap44xx()) {
Signature · 4 lines
1.5.4.7

--
To unsubscribe from this list: send the line "unsubscribe 

linux-omap" in

Quoted 2 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html