lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  2 Oct 2015 15:40:23 +0200
From:	Javier Martinez Canillas <javier@....samsung.com>
To:	linux-kernel@...r.kernel.org
Cc:	Javier Martinez Canillas <javier@....samsung.com>,
	Rob Herring <robh@...nel.org>,
	Pramod Gurav <pramod.gurav@...rtplayin.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	linux-input@...r.kernel.org,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: [PATCH 12/18] Input: pxa27x_keypad - simplify function return logic

The invoked function already returns zero on success or a negative
errno code so there is no need to open code the logic in the caller.

This also fixes the following make coccicheck warning:

drivers/input/keyboard/pxa27x_keypad.c:141:1-6: WARNING: end returns can be simplified

Signed-off-by: Javier Martinez Canillas <javier@....samsung.com>
---

 drivers/input/keyboard/pxa27x_keypad.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index fcef5d1365e2..436e8c2efbe5 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -138,14 +138,10 @@ static int pxa27x_keypad_matrix_key_parse_dt(struct pxa27x_keypad *keypad,
 	pdata->matrix_key_rows = rows;
 	pdata->matrix_key_cols = cols;
 
-	error = matrix_keypad_build_keymap(NULL, NULL,
-					   pdata->matrix_key_rows,
-					   pdata->matrix_key_cols,
-					   keypad->keycodes, input_dev);
-	if (error)
-		return error;
-
-	return 0;
+	return matrix_keypad_build_keymap(NULL, NULL,
+					  pdata->matrix_key_rows,
+					  pdata->matrix_key_cols,
+					  keypad->keycodes, input_dev);
 }
 
 static int pxa27x_keypad_direct_key_parse_dt(struct pxa27x_keypad *keypad,
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ