提交 5ec69524 编写于 作者: D Dmitry Torokhov

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: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 6ecfe51b
...@@ -87,7 +87,7 @@ static int joydev_correct(int value, struct js_corr *corr) ...@@ -87,7 +87,7 @@ static int joydev_correct(int value, struct js_corr *corr)
return 0; return 0;
} }
return value < -32767 ? -32767 : (value > 32767 ? 32767 : value); return clamp(value, -32767, 32767);
} }
static void joydev_pass_event(struct joydev_client *client, static void joydev_pass_event(struct joydev_client *client,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册