diff mbox series

[lvc-project,v2] Input: trackpoint - remove unreachable code

Message ID 20230317133909.1564390-1-Igor.A.Artemiev@mcst.ru (mailing list archive)
State New, archived
Headers show
Series [lvc-project,v2] Input: trackpoint - remove unreachable code | expand

Commit Message

Igor Artemiev March 17, 2023, 1:39 p.m. UTC
The trackpoint_sync() function always returns 0.
And there is no need to check its result.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
---
v2: make the trackpoint_sync() a void function 
as Andi Shyti <andi.shyti@kernel.org> suggested.
 
 drivers/input/mouse/trackpoint.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
index 4a86b3e31d3b..2c381377ad4b 100644
--- a/drivers/input/mouse/trackpoint.c
+++ b/drivers/input/mouse/trackpoint.c
@@ -300,7 +300,7 @@  static int trackpoint_start_protocol(struct psmouse *psmouse,
  *		      power-on reset was run). If so, values will only be
  *		      written to TP if they differ from power-on default.
  */
-static int trackpoint_sync(struct psmouse *psmouse, bool in_power_on_state)
+static void trackpoint_sync(struct psmouse *psmouse, bool in_power_on_state)
 {
 	struct trackpoint_data *tp = psmouse->private;
 
@@ -340,8 +340,6 @@  static int trackpoint_sync(struct psmouse *psmouse, bool in_power_on_state)
 	TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, press_to_select);
 	TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, skipback);
 	TRACKPOINT_UPDATE(in_power_on_state, psmouse, tp, ext_dev);
-
-	return 0;
 }
 
 static void trackpoint_defaults(struct trackpoint_data *tp)
@@ -386,9 +384,7 @@  static int trackpoint_reconnect(struct psmouse *psmouse)
 	was_reset = tp->variant_id == TP_VARIANT_IBM &&
 		    trackpoint_power_on_reset(&psmouse->ps2dev) == 0;
 
-	error = trackpoint_sync(psmouse, was_reset);
-	if (error)
-		return error;
+	trackpoint_sync(psmouse, was_reset);
 
 	return 0;
 }