diff mbox series

HID: wacom: simplify if-if to if-else

Message ID 20220424085826.96447-1-wanjiabing@vivo.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show
Series HID: wacom: simplify if-if to if-else | expand

Commit Message

Jiabing Wan April 24, 2022, 8:58 a.m. UTC
Use if and else instead of if(A) and if (!A).

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
 drivers/hid/wacom_wac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 64fe573deb9b..886e87f1c8bb 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -181,10 +181,10 @@  static int wacom_pl_irq(struct wacom_wac *wacom)
 		input_report_key(input, BTN_STYLUS, data[4] & 0x10);
 		/* Only allow the stylus2 button to be reported for the pen tool. */
 		input_report_key(input, BTN_STYLUS2, (wacom->tool[0] == BTN_TOOL_PEN) && (data[4] & 0x20));
+	} else {
+		wacom->id[0] = 0;
 	}
 
-	if (!prox)
-		wacom->id[0] = 0;
 	input_report_key(input, wacom->tool[0], prox);
 	input_report_abs(input, ABS_MISC, wacom->id[0]);
 	return 1;