[PATCH 11/13] ARM: OMAP3+: SmartReflex: micro-optimization for sanity check

Jean Pihet jean.pihet at newoldbits.com
Wed Feb 29 17:33:47 EST 2012


From: Felipe Balbi <balbi at ti.com>

val && (val != 1) == val > 1

Signed-off-by: Felipe Balbi <balbi at ti.com>
Signed-off-by: Jean Pihet <j-pihet at ti.com>
---
 arch/arm/mach-omap2/smartreflex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 2774cf3..d0867b6 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -886,7 +886,7 @@ static int omap_sr_autocomp_store(void *data, u64 val)
 	}
 
 	/* Sanity check */
-	if (val && (val != 1)) {
+	if (val > 1) {
 		pr_warning("%s: Invalid argument %lld\n", __func__, val);
 		return -EINVAL;
 	}
-- 
1.7.5.4




More information about the linux-arm-kernel mailing list