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-next>] [day] [month] [year] [list]
Message-Id: <20190524060328.3827-1-nishkadg.linux@gmail.com>
Date:   Fri, 24 May 2019 11:33:28 +0530
From:   Nishka Dasgupta <nishkadg.linux@...il.com>
To:     gregkh@...uxfoundation.org, thesven73@...il.com, hofrat@...dl.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc:     Nishka Dasgupta <nishkadg.linux@...il.com>
Subject: [PATCH] staging: fieldbus: anybuss: Remove variables

The local variable cd, used in multiple functions, is immediately passed
to another function call, whose result is returned. As that is the only
use of cd, it can be replaced with its variable.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@...il.com>
---
 drivers/staging/fieldbus/anybuss/host.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c
index f69dc4930457..9679cd0b737b 100644
--- a/drivers/staging/fieldbus/anybuss/host.c
+++ b/drivers/staging/fieldbus/anybuss/host.c
@@ -1046,10 +1046,8 @@ EXPORT_SYMBOL_GPL(anybuss_start_init);
 
 int anybuss_finish_init(struct anybuss_client *client)
 {
-	struct anybuss_host *cd = client->host;
-
-	return _anybus_mbox_cmd(cd, CMD_END_INIT, false, NULL, 0,
-					NULL, 0, NULL, 0);
+	return _anybus_mbox_cmd(client->host, CMD_END_INIT, false, NULL, 0,
+				NULL, 0, NULL, 0);
 }
 EXPORT_SYMBOL_GPL(anybuss_finish_init);
 
@@ -1146,20 +1144,16 @@ EXPORT_SYMBOL_GPL(anybuss_send_msg);
 int anybuss_send_ext(struct anybuss_client *client, u16 cmd_num,
 		     const void *buf, size_t count)
 {
-	struct anybuss_host *cd = client->host;
-
-	return _anybus_mbox_cmd(cd, cmd_num, true, NULL, 0, NULL, 0,
-					buf, count);
+	return _anybus_mbox_cmd(client->host, cmd_num, true, NULL, 0, NULL, 0,
+				buf, count);
 }
 EXPORT_SYMBOL_GPL(anybuss_send_ext);
 
 int anybuss_recv_msg(struct anybuss_client *client, u16 cmd_num,
 		     void *buf, size_t count)
 {
-	struct anybuss_host *cd = client->host;
-
-	return _anybus_mbox_cmd(cd, cmd_num, true, NULL, 0, buf, count,
-					NULL, 0);
+	return _anybus_mbox_cmd(client->host, cmd_num, true, NULL, 0, buf,
+				count, NULL, 0);
 }
 EXPORT_SYMBOL_GPL(anybuss_recv_msg);
 
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ