summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorChristos Gkekas <chris.gekas@gmail.com>2017-07-08 20:25:48 +0100
committerJiri Kosina <jkosina@suse.cz>2017-07-20 15:43:01 +0200
commitbc35f73aa62f51b80f769d3a6617f4a4ba11d81e (patch)
tree67f619dca225607fc27f84c79c962050ec899df1 /drivers/hid
parenta91ab911df51ac364e594d5950ed508d91091498 (diff)
HID: wacom: Remove comparison of u8 mode with zero and simplify.
Variable mode in method wacom_show_remote_mode() is defined as u8, thus statement (mode >= 0) is always true and should be removed, simplifying the logic. Signed-off-by: Christos Gkekas <chris.gekas@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_sys.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 838c1ebfffa9..ae2408d5e53d 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -1671,10 +1671,7 @@ static ssize_t wacom_show_remote_mode(struct kobject *kobj,
u8 mode;
mode = wacom->led.groups[index].select;
- if (mode >= 0 && mode < 3)
- return snprintf(buf, PAGE_SIZE, "%d\n", mode);
- else
- return snprintf(buf, PAGE_SIZE, "%d\n", -1);
+ return sprintf(buf, "%d\n", mode < 3 ? mode : -1);
}
#define DEVICE_EKR_ATTR_GROUP(SET_ID) \