diff mbox series

input: elantech: remove redundant assignments to variable error

Message ID 20200603140431.131347-1-colin.king@canonical.com
State Accepted
Commit 05b8465025466f30300941a16d4bbf53c755c3f1
Headers show
Series input: elantech: remove redundant assignments to variable error | expand

Commit Message

Colin King June 3, 2020, 2:04 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable error is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/input/mouse/elantech.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dmitry Torokhov July 7, 2020, 12:38 a.m. UTC | #1
On Wed, Jun 03, 2020 at 03:04:31PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>

> 

> The variable error is being initialized with a value that is

> never read and it is being updated later with a new value. The

> initialization is redundant and can be removed.

> 

> Addresses-Coverity: ("Unused value")

> Signed-off-by: Colin Ian King <colin.king@canonical.com>


Applied, thank you.

-- 
Dmitry
diff mbox series

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 2d8434b7b623..e4f394cc0520 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1897,7 +1897,7 @@  static bool elantech_use_host_notify(struct psmouse *psmouse,
 int elantech_init_smbus(struct psmouse *psmouse)
 {
 	struct elantech_device_info info;
-	int error = -EINVAL;
+	int error;
 
 	psmouse_reset(psmouse);
 
@@ -2015,7 +2015,7 @@  static int elantech_setup_ps2(struct psmouse *psmouse,
 int elantech_init_ps2(struct psmouse *psmouse)
 {
 	struct elantech_device_info info;
-	int error = -EINVAL;
+	int error;
 
 	psmouse_reset(psmouse);
 
@@ -2036,7 +2036,7 @@  int elantech_init_ps2(struct psmouse *psmouse)
 int elantech_init(struct psmouse *psmouse)
 {
 	struct elantech_device_info info;
-	int error = -EINVAL;
+	int error;
 
 	psmouse_reset(psmouse);