diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-01-28 11:01:33 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-02-01 10:39:40 -0800 |
commit | 5ec69524d43095752510fdcdadc4a6baf50d7c18 (patch) | |
tree | 940b85415931aa88c1d346ebae77445f57b22aaf | |
parent | 6ecfe51b4082e7cff12609f97daa052ae04b61fd (diff) | |
download | blackbird-op-linux-5ec69524d43095752510fdcdadc4a6baf50d7c18.tar.gz blackbird-op-linux-5ec69524d43095752510fdcdadc4a6baf50d7c18.zip |
Input: joydev - use clamp() macro
We have a nice macro ensuring that the value is within certain range, let's
use it instead of open-coding.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/joydev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index abd18f31b24f..5298a762b615 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -87,7 +87,7 @@ static int joydev_correct(int value, struct js_corr *corr) return 0; } - return value < -32767 ? -32767 : (value > 32767 ? 32767 : value); + return clamp(value, -32767, 32767); } static void joydev_pass_event(struct joydev_client *client, |