[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220424085826.96447-1-wanjiabing@vivo.com>
Date: Sun, 24 Apr 2022 16:58:26 +0800
From: Wan Jiabing <wanjiabing@...o.com>
To: Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: kael_w@...h.net, Wan Jiabing <wanjiabing@...o.com>
Subject: [PATCH] HID: wacom: simplify if-if to if-else
Use if and else instead of if(A) and if (!A).
Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
---
drivers/hid/wacom_wac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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;
--
2.35.1
Powered by blists - more mailing lists