linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] be2net: remove redundant initialization of 'head' and pointer txq
@ 2018-01-31 16:14 Colin King
  2018-02-01 14:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-31 16:14 UTC (permalink / raw)
  To: Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna,
	Somnath Kotur, netdev
  Cc: kernel-janitors, linux-kernel

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

Variable head is initialized to a value that is never read and is
being updated to a new value a few lines later, hence this
initialization is redundant and can be safely removed as well
as the now unused pointer txq.

Cleans up clang warning:
drivers/net/ethernet/emulex/benet/be_main.c:996:6: warning: Value
stored to 'head' during its initialization is never read

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

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index c36c81959198..d81e2d37bc3d 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -991,9 +991,8 @@ static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
 {
 	u32 i, copied = 0, wrb_cnt = skb_wrb_cnt(skb);
 	struct device *dev = &adapter->pdev->dev;
-	struct be_queue_info *txq = &txo->q;
 	bool map_single = false;
-	u32 head = txq->head;
+	u32 head;
 	dma_addr_t busaddr;
 	int len;
 
-- 
2.15.1

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

* Re: [PATCH] be2net: remove redundant initialization of 'head' and pointer txq
  2018-01-31 16:14 [PATCH] be2net: remove redundant initialization of 'head' and pointer txq Colin King
@ 2018-02-01 14:43 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-02-01 14:43 UTC (permalink / raw)
  To: colin.king
  Cc: sathya.perla, ajit.khaparde, sriharsha.basavapatna,
	somnath.kotur, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Wed, 31 Jan 2018 16:14:25 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> Variable head is initialized to a value that is never read and is
> being updated to a new value a few lines later, hence this
> initialization is redundant and can be safely removed as well
> as the now unused pointer txq.
> 
> Cleans up clang warning:
> drivers/net/ethernet/emulex/benet/be_main.c:996:6: warning: Value
> stored to 'head' during its initialization is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thank you.

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

end of thread, other threads:[~2018-02-01 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 16:14 [PATCH] be2net: remove redundant initialization of 'head' and pointer txq Colin King
2018-02-01 14:43 ` 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).