Skip to content

Commit

Permalink
Input: use clamp_val() macro in ff-memless.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Harvey Harrison authored and Dmitry Torokhov committed May 16, 2008
1 parent c6a3ead commit 9231047
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/ff-memless.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9231047

Please sign in to comment.