Skip to content

Commit 8f9cfdd

Browse files
Dan CarpenterJiri Kosina
authored andcommitted
HID: wacom: bitwise vs logical ORs
Smatch complains that these should probably be bitwise ORs instead of logical. It doesn't matter for "prox" but it makes a difference for "strip1" and "strip2". Fixes: c7f0522 ('HID: wacom: Slim down wacom_intuos_pad processing') Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Jason Gerecke <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent be853fd commit 8f9cfdd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hid/wacom_wac.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
545545
((data[6] & 0x0F) << 4) |
546546
(data[5] & 0x0F);
547547
}
548-
strip1 = (data[1] << 8) || data[2];
549-
strip2 = (data[3] << 8) || data[4];
548+
strip1 = (data[1] << 8) | data[2];
549+
strip2 = (data[3] << 8) | data[4];
550550
}
551551

552-
prox = (buttons & ~(~0 << nbuttons)) || (keys & ~(~0 << nkeys)) ||
553-
(ring1 & 0x80) || (ring2 & 0x80) || strip1 || strip2;
552+
prox = (buttons & ~(~0 << nbuttons)) | (keys & ~(~0 << nkeys)) |
553+
(ring1 & 0x80) | (ring2 & 0x80) | strip1 | strip2;
554554

555555
wacom_report_numbered_buttons(input, nbuttons, buttons);
556556

0 commit comments

Comments
 (0)