Explorar el Código

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>
Harvey Harrison hace 17 años
padre
commit
923104747d
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      drivers/input/ff-memless.c

+ 2 - 2
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: