ARM: OMAP3+: SmartReflex: micro-optimization for sanity check
authorFelipe Balbi <balbi@ti.com>
Wed, 29 Feb 2012 22:33:47 +0000 (23:33 +0100)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 15 May 2016 12:43:21 +0000 (15:43 +0300)
val && (val != 1) == val > 1

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/smartreflex.c

index 4b9dc8b..9460d3a 100644 (file)
@@ -886,7 +886,7 @@ static int omap_sr_autocomp_store(void *data, u64 val)
        }
 
        /* Sanity check */
        }
 
        /* Sanity check */
-       if (val && (val != 1)) {
+       if (val > 1) {
                pr_warning("%s: Invalid argument %lld\n", __func__, val);
                return -EINVAL;
        }
                pr_warning("%s: Invalid argument %lld\n", __func__, val);
                return -EINVAL;
        }