Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659305 > unrolled thread

[PATCH] i40evf: remove redundant null check on key

Started byColin King <colin.king@canonical.com>
First post2017-06-07 02:00 +0200
Last post2017-06-07 02:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] i40evf: remove redundant null check on key Colin King <colin.king@canonical.com> - 2017-06-07 02:00 +0200

#1659305 — [PATCH] i40evf: remove redundant null check on key

FromColin King <colin.king@canonical.com>
Date2017-06-07 02:00 +0200
Subject[PATCH] i40evf: remove redundant null check on key
Message-ID<tPwyd-7dr-7@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

key has previously been null checked so the subsequent null check
is redundant as key can never be null at that point, so remove it.

Detected by CoverityScan, CID#1357164 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index 9bb2cc7dd4e4..838e57c6e176 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -732,9 +732,7 @@ static int i40evf_set_rxfh(struct net_device *netdev, const u32 *indir,
 	if (!indir)
 		return 0;
 
-	if (key) {
-		memcpy(adapter->rss_key, key, adapter->rss_key_size);
-	}
+	memcpy(adapter->rss_key, key, adapter->rss_key_size);
 
 	/* Each 32 bits pointed by 'indir' is stored with a lut entry */
 	for (i = 0; i < adapter->rss_lut_size; i++)
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web