OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ecfe51
)
Input: joydev - use clamp() macro
author
Dmitry Torokhov
<dmitry.torokhov@gmail.com>
Sat, 28 Jan 2017 19:01:33 +0000
(11:01 -0800)
committer
Dmitry Torokhov
<dmitry.torokhov@gmail.com>
Wed, 1 Feb 2017 18:39:40 +0000
(10:39 -0800)
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>
drivers/input/joydev.c
patch
|
blob
|
history
diff --git
a/drivers/input/joydev.c
b/drivers/input/joydev.c
index
abd18f3
..
5298a76
100644
(file)
--- 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,