]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Input: use clamp_val() macro in ff-memless.c
authorHarvey Harrison <harvey.harrison@gmail.com>
Mon, 5 May 2008 15:50:59 +0000 (11:50 -0400)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 16 May 2008 18:49:47 +0000 (14:49 -0400)
Replace two opencoded nested min/max macros with clamp_val().

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/ff-memless.c

index d226d935b0dcd57afc9c0e3fb921c47f3005bf92..6790e975a98c327fd038198f535be9fc9059ab5b 100644 (file)
@@ -247,9 +247,9 @@ static void ml_combine_effects(struct ff_effect *effect,
                 * in s8, this should be changed to something more generic
                 */
                effect->u.ramp.start_level =
-                       max(min(effect->u.ramp.start_level + x, 0x7f), -0x80);
+                       clamp_val(effect->u.ramp.start_level + x, -0x80, 0x7f);
                effect->u.ramp.end_level =
-                       max(min(effect->u.ramp.end_level + y, 0x7f), -0x80);
+                       clamp_val(effect->u.ramp.end_level + y, -0x80, 0x7f);
                break;
 
        case FF_RUMBLE: