LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] qed: remove redundant assignment to variable 'rc'
@ 2020-04-05 13:49 Colin King
  2020-04-06 17:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-04-05 13:49 UTC (permalink / raw)
  To: Ariel Elior, GR-everest-linux-l2, David S . Miller, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable 'rc' is being assigned a value that is never read
and it is being updated later with a new value. The assignment
is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/qlogic/qed/qed_l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_l2.c b/drivers/net/ethernet/qlogic/qed/qed_l2.c
index 1a5fc2ae351c..29810a1aa210 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_l2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_l2.c
@@ -369,8 +369,8 @@ int qed_sp_eth_vport_start(struct qed_hwfn *p_hwfn,
 	struct qed_spq_entry *p_ent =  NULL;
 	struct qed_sp_init_data init_data;
 	u8 abs_vport_id = 0;
-	int rc = -EINVAL;
 	u16 rx_mode = 0;
+	int rc;
 
 	rc = qed_fw_vport(p_hwfn, p_params->vport_id, &abs_vport_id);
 	if (rc)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] qed: remove redundant assignment to variable 'rc'
  2020-04-05 13:49 [PATCH] qed: remove redundant assignment to variable 'rc' Colin King
@ 2020-04-06 17:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-04-06 17:22 UTC (permalink / raw)
  To: colin.king
  Cc: aelior, GR-everest-linux-l2, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Sun,  5 Apr 2020 14:49:14 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable 'rc' is being assigned a value that is never read
> and it is being updated later with a new value. The assignment
> is redundant and can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-06 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-05 13:49 [PATCH] qed: remove redundant assignment to variable 'rc' Colin King
2020-04-06 17:22 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).