Skip to content

Commit bc35f73

Browse files
chggrJiri Kosina
authored andcommitted
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>
1 parent a91ab91 commit bc35f73

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/hid/wacom_sys.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,10 +1671,7 @@ static ssize_t wacom_show_remote_mode(struct kobject *kobj,
16711671
u8 mode;
16721672

16731673
mode = wacom->led.groups[index].select;
1674-
if (mode >= 0 && mode < 3)
1675-
return snprintf(buf, PAGE_SIZE, "%d\n", mode);
1676-
else
1677-
return snprintf(buf, PAGE_SIZE, "%d\n", -1);
1674+
return sprintf(buf, "%d\n", mode < 3 ? mode : -1);
16781675
}
16791676

16801677
#define DEVICE_EKR_ATTR_GROUP(SET_ID) \

0 commit comments

Comments
 (0)