提交 bc35f73a 编写于 作者: C Christos Gkekas 提交者: Jiri Kosina

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: NChristos Gkekas <chris.gekas@gmail.com>
Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 a91ab911
...@@ -1671,10 +1671,7 @@ static ssize_t wacom_show_remote_mode(struct kobject *kobj, ...@@ -1671,10 +1671,7 @@ static ssize_t wacom_show_remote_mode(struct kobject *kobj,
u8 mode; u8 mode;
mode = wacom->led.groups[index].select; mode = wacom->led.groups[index].select;
if (mode >= 0 && mode < 3) return sprintf(buf, "%d\n", mode < 3 ? mode : -1);
return snprintf(buf, PAGE_SIZE, "%d\n", mode);
else
return snprintf(buf, PAGE_SIZE, "%d\n", -1);
} }
#define DEVICE_EKR_ATTR_GROUP(SET_ID) \ #define DEVICE_EKR_ATTR_GROUP(SET_ID) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册