From: Harvey Harrison Date: Mon, 5 May 2008 15:50:59 +0000 (-0400) Subject: Input: use clamp_val() macro in ff-memless.c X-Git-Tag: v2.6.27-rc1~958^2~46 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=923104747d5c4d58762aa865f71d48d3beb73ae6;p=linux-2.6 Input: use clamp_val() macro in ff-memless.c Replace two opencoded nested min/max macros with clamp_val(). Signed-off-by: Harvey Harrison Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index d226d935b0..6790e975a9 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -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: