aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-05-05 11:50:59 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-05-16 14:49:47 -0400
commit923104747d5c4d58762aa865f71d48d3beb73ae6 (patch)
treef9c129f7ef168933d7ced94558ca9db342b5c0f8 /drivers/input
parentc6a3ead2ab5d82b549237c52a785b9f736e13463 (diff)
Input: use clamp_val() macro in ff-memless.c
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>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/ff-memless.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index d226d935b0d..6790e975a98 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: