All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: simplify if-if to if-else
@ 2022-04-24  8:58 Wan Jiabing
  0 siblings, 0 replies; only message in thread
From: Wan Jiabing @ 2022-04-24  8:58 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel
  Cc: kael_w, Wan Jiabing

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 --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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-24  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24  8:58 [PATCH] HID: wacom: simplify if-if to if-else Wan Jiabing

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.