linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* arch/arm/mach-omap2/vc.c:302: bad if test ?
@ 2015-08-28  9:25 David Binderman
  2015-08-28 10:10 ` [PATCH] arm: omap2: vc: fix 'or' always true warning Frans Klaver
  0 siblings, 1 reply; 4+ messages in thread
From: David Binderman @ 2015-08-28  9:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hello there,

arch/arm/mach-omap2/vc.c:302:47: warning: logical ?or? of collectively exhaustive tests is always true [-Wlogical-op]

Source code is

??????? if (!(val & OMAP3430_PRM_POLCTRL_CLKREQ_POL) ||
??????????? (val & OMAP3430_PRM_POLCTRL_CLKREQ_POL)) {

Suggest code rework.

Regards

David Binderman

 		 	   		  

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

* [PATCH] arm: omap2: vc: fix 'or' always true warning
  2015-08-28  9:25 arch/arm/mach-omap2/vc.c:302: bad if test ? David Binderman
@ 2015-08-28 10:10 ` Frans Klaver
  2015-09-01 15:46   ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Frans Klaver @ 2015-08-28 10:10 UTC (permalink / raw)
  To: linux-arm-kernel

From: Frans Klaver <fransklaver@gmail.com>

Fix the warning:
arch/arm/mach-omap2/vc.c:302:47: warning: logical ?or? of collectively exhaustive tests is always true [-Wlogical-op]

As we're toggling both CLKREQ and OFFMODE, we should also be checking
OFFMODE.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
---
 arch/arm/mach-omap2/vc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
index 076fd20d7e5a..807bc79e3e3d 100644
--- a/arch/arm/mach-omap2/vc.c
+++ b/arch/arm/mach-omap2/vc.c
@@ -300,7 +300,7 @@ static void __init omap3_vc_init_pmic_signaling(struct voltagedomain *voltdm)
 
 	val = voltdm->read(OMAP3_PRM_POLCTRL_OFFSET);
 	if (!(val & OMAP3430_PRM_POLCTRL_CLKREQ_POL) ||
-	    (val & OMAP3430_PRM_POLCTRL_CLKREQ_POL)) {
+	    (val & OMAP3430_PRM_POLCTRL_OFFMODE_POL)) {
 		val |= OMAP3430_PRM_POLCTRL_CLKREQ_POL;
 		val &= ~OMAP3430_PRM_POLCTRL_OFFMODE_POL;
 		pr_debug("PM: fixing sys_clkreq and sys_off_mode polarity to 0x%x\n",
-- 
2.3.4

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

* [PATCH] arm: omap2: vc: fix 'or' always true warning
  2015-08-28 10:10 ` [PATCH] arm: omap2: vc: fix 'or' always true warning Frans Klaver
@ 2015-09-01 15:46   ` Tony Lindgren
  2015-09-01 18:21     ` Frans Klaver
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2015-09-01 15:46 UTC (permalink / raw)
  To: linux-arm-kernel

* Frans Klaver <frans.klaver@xsens.com> [150828 03:14]:
> From: Frans Klaver <fransklaver@gmail.com>
> 
> Fix the warning:
> arch/arm/mach-omap2/vc.c:302:47: warning: logical ?or? of collectively exhaustive tests is always true [-Wlogical-op]
> 
> As we're toggling both CLKREQ and OFFMODE, we should also be checking
> OFFMODE.
> 
> Signed-off-by: Frans Klaver <fransklaver@gmail.com>

Thanks apppying into omap-for-v4.3/fixes.

Tony

> ---
>  arch/arm/mach-omap2/vc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
> index 076fd20d7e5a..807bc79e3e3d 100644
> --- a/arch/arm/mach-omap2/vc.c
> +++ b/arch/arm/mach-omap2/vc.c
> @@ -300,7 +300,7 @@ static void __init omap3_vc_init_pmic_signaling(struct voltagedomain *voltdm)
>  
>  	val = voltdm->read(OMAP3_PRM_POLCTRL_OFFSET);
>  	if (!(val & OMAP3430_PRM_POLCTRL_CLKREQ_POL) ||
> -	    (val & OMAP3430_PRM_POLCTRL_CLKREQ_POL)) {
> +	    (val & OMAP3430_PRM_POLCTRL_OFFMODE_POL)) {
>  		val |= OMAP3430_PRM_POLCTRL_CLKREQ_POL;
>  		val &= ~OMAP3430_PRM_POLCTRL_OFFMODE_POL;
>  		pr_debug("PM: fixing sys_clkreq and sys_off_mode polarity to 0x%x\n",
> -- 
> 2.3.4
> 

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

* [PATCH] arm: omap2: vc: fix 'or' always true warning
  2015-09-01 15:46   ` Tony Lindgren
@ 2015-09-01 18:21     ` Frans Klaver
  0 siblings, 0 replies; 4+ messages in thread
From: Frans Klaver @ 2015-09-01 18:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 1, 2015 at 5:46 PM, Tony Lindgren <tony@atomide.com> wrote:
> * Frans Klaver <frans.klaver@xsens.com> [150828 03:14]:
>> From: Frans Klaver <fransklaver@gmail.com>
>>
>> Fix the warning:
>> arch/arm/mach-omap2/vc.c:302:47: warning: logical ?or? of collectively exhaustive tests is always true [-Wlogical-op]
>>
>> As we're toggling both CLKREQ and OFFMODE, we should also be checking
>> OFFMODE.
>>
>> Signed-off-by: Frans Klaver <fransklaver@gmail.com>
>
> Thanks apppying into omap-for-v4.3/fixes.

Thanks!

Frans

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

end of thread, other threads:[~2015-09-01 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-28  9:25 arch/arm/mach-omap2/vc.c:302: bad if test ? David Binderman
2015-08-28 10:10 ` [PATCH] arm: omap2: vc: fix 'or' always true warning Frans Klaver
2015-09-01 15:46   ` Tony Lindgren
2015-09-01 18:21     ` Frans Klaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).