Input: use clamp_val() macro in ff-memless.c
[pandora-kernel.git] / drivers / input / ff-memless.c
index cd8b729..6790e97 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
-#include <linux/sched.h>
+#include <linux/jiffies.h>
 
 #include "fixp-arith.h"
 
@@ -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:
@@ -460,7 +460,7 @@ static void ml_ff_destroy(struct ff_device *ff)
 }
 
 /**
- * input_ff_create_memless() - create memoryless FF device
+ * input_ff_create_memless() - create memoryless force-feedback device
  * @dev: input device supporting force-feedback
  * @data: driver-specific data to be passed into @play_effect
  * @play_effect: driver-specific method for playing FF effect