lkml.org 
[lkml]   [2011]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH/RESEND #3 7/7] arm: omap: smartreflex: micro-optimization for sanity check
    Date
    val && (val != 1) == val > 1

    Signed-off-by: Felipe Balbi <balbi@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 a5399df..9fee277 100644
    --- a/arch/arm/mach-omap2/smartreflex.c
    +++ b/arch/arm/mach-omap2/smartreflex.c
    @@ -868,7 +868,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.8.rc0


    \
     
     \ /
      Last update: 2011-11-15 09:49    [W:0.024 / U:0.232 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site