]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Input: joydev - use clamp() macro
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 28 Jan 2017 19:01:33 +0000 (11:01 -0800)
committerDmitry 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

index abd18f31b24f68e27c28f1120e52aa96b9347887..5298a762b61588ea397c2ea95f357b17033e0819 100644 (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,