Commit 923104747d5c4d58762aa865f71d48d3beb73ae6

Authored by Harvey Harrison
Committed by Dmitry Torokhov
1 parent c6a3ead2ab

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>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/input/ff-memless.c
... ... @@ -247,9 +247,9 @@
247 247 * in s8, this should be changed to something more generic
248 248 */
249 249 effect->u.ramp.start_level =
250   - max(min(effect->u.ramp.start_level + x, 0x7f), -0x80);
  250 + clamp_val(effect->u.ramp.start_level + x, -0x80, 0x7f);
251 251 effect->u.ramp.end_level =
252   - max(min(effect->u.ramp.end_level + y, 0x7f), -0x80);
  252 + clamp_val(effect->u.ramp.end_level + y, -0x80, 0x7f);
253 253 break;
254 254  
255 255 case FF_RUMBLE: