2022-04-22 19:09:41

by baihaowen

[permalink] [raw]
Subject: [PATCH] Input: Remove duplicated condition

Remove the duplicated condition, and make code clear.

Signed-off-by: Haowen Bai <[email protected]>
---
drivers/input/mouse/hgpk.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 4dc441309aac..7c6b669b687f 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -611,9 +611,7 @@ static int hgpk_reset_device(struct psmouse *psmouse, bool recalibrate)

/* send the recalibrate request */
if (ps2_command(ps2dev, NULL, 0xf5) ||
- ps2_command(ps2dev, NULL, 0xf5) ||
- ps2_command(ps2dev, NULL, 0xe6) ||
- ps2_command(ps2dev, NULL, 0xf5)) {
+ ps2_command(ps2dev, NULL, 0xe6)) {
return -1;
}

@@ -728,7 +726,6 @@ static int hgpk_toggle_powersave(struct psmouse *psmouse, int enable)
psmouse_dbg(psmouse, "Powering off touchpad.\n");

if (ps2_command(ps2dev, NULL, 0xec) ||
- ps2_command(ps2dev, NULL, 0xec) ||
ps2_command(ps2dev, NULL, 0xea)) {
return -1;
}
--
2.7.4