summaryrefslogtreecommitdiff
path: root/drivers/input/ff-core.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-09-30 02:02:29 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-09-30 02:09:36 +0300
commit379d7cfa9bcae3b89299fdcb135ec0e2810e97bc (patch)
treeeb440160dd851c8103c0ca44b253c803ec166fd7 /drivers/input/ff-core.c
parentb83b14598ffbb59bc96dbd3d4350a3b8f0287bb2 (diff)
downloadlinux-379d7cfa9bcae3b89299fdcb135ec0e2810e97bc.tar.xz
Input: ff-core - silence an underflow warning
My static checker complains that "value" comes from the user in evdev_do_ioctl() and we check that it's not too large here but we don't check that it's negative. It's harmless because the ->set_gain() and ->set_autocenter() functions truncate it to a valid u16 value, but we may as well fix it just to make the static checker happy. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/ff-core.c')
-rw-r--r--drivers/input/ff-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c
index c64208267198..eab56c0aacd5 100644
--- a/drivers/input/ff-core.c
+++ b/drivers/input/ff-core.c
@@ -273,14 +273,14 @@ int input_ff_event(struct input_dev *dev, unsigned int type,
switch (code) {
case FF_GAIN:
- if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffff)
+ if (!test_bit(FF_GAIN, dev->ffbit) || value > 0xffffU)
break;
ff->set_gain(dev, value);
break;
case FF_AUTOCENTER:
- if (!test_bit(FF_AUTOCENTER, dev->ffbit) || value > 0xffff)
+ if (!test_bit(FF_AUTOCENTER, dev->ffbit) || value > 0xffffU)
break;
ff->set_autocenter(dev, value);