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>
This commit is contained in:
Dmitry Torokhov 2017-01-28 11:01:33 -08:00
parent 6ecfe51b40
commit 5ec69524d4

View File

@ -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,