Skip to contentSkip to conversation

ARM: OMAP2+: use true and false for bool variable

PATCH In review Yang Li 2 participants 2 messages Mar 15, 2021 – Mar 24, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 ARM: OMAP2+: use true and false for bool variable

fixed the following coccicheck:
./arch/arm/mach-omap2/powerdomain.c:1205:9-10: WARNING: return of 0/1 in function 'pwrdm_can_ever_lose_context' with return type bool

---
 arch/arm/mach-omap2/powerdomain.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/powerdomain.c +6 -6
index 1cbac76..0a5b87e 100644
@@ -1202,26 +1202,26 @@ bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm)
 	if (!pwrdm) {
 		pr_debug("powerdomain: %s: invalid powerdomain pointer\n",
 			 __func__);
-		return 1;
+		return true;
 	}
 
 	if (pwrdm->pwrsts & PWRSTS_OFF)
-		return 1;
+		return true;
 
 	if (pwrdm->pwrsts & PWRSTS_RET) {
 		if (pwrdm->pwrsts_logic_ret & PWRSTS_OFF)
-			return 1;
+			return true;
 
 		for (i = 0; i < pwrdm->banks; i++)
 			if (pwrdm->pwrsts_mem_ret[i] & PWRSTS_OFF)
-				return 1;
+				return true;
 	}
 
 	for (i = 0; i < pwrdm->banks; i++)
 		if (pwrdm->pwrsts_mem_on[i] & PWRSTS_OFF)
-			return 1;
+			return true;
 
-	return 0;
+	return false;
 }
 
 /**
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 3 lines · Yang Li

fixed the following coccicheck:
./arch/arm/mach-omap2/powerdomain.c:1205:9-10: WARNING: return of 0/1 in function 'pwrdm_can_ever_lose_context' with return type bool

Thanks applying into omap-for-v5.13/soc.

Tony