mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 09/10] input: ff-memless.c use clamp_val() macro
@ 2008-03-14  5:21 Harvey Harrison
  0 siblings, 0 replies; only message in thread
From: Harvey Harrison @ 2008-03-14  5:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

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

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 drivers/input/ff-memless.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index d226d93..6790e97 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:
-- 
1.5.4.4.653.g7cf1e



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-14  5:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-14  5:21 [PATCH 09/10] input: ff-memless.c use clamp_val() macro Harvey Harrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®