Skip to contentSkip to conversation

input: ff-memless.c use clamp_val() macro

PATCH In review Harvey Harrison 1 participant 1 message Mar 14, 2008 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 9/10 input: ff-memless.c use clamp_val() macro

Replace two opencoded nested min/max macros with clamp_val().

---
 drivers/input/ff-memless.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/input/ff-memless.c +2 -2
index d226d93..6790e97 100644
@@ -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:
Signature · 1 line
1.5.4.4.653.g7cf1e