From: Dmitry Torokhov Date: Sat, 28 Jan 2017 19:01:33 +0000 (-0800) Subject: Input: joydev - use clamp() macro X-Git-Tag: v5.15~74^2~376^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ec69524d43095752510fdcdadc4a6baf50d7c18;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index abd18f3..5298a76 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,