netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: jme: remove unused initialization of 'rxdesc'
@ 2018-02-01 16:58 Colin King
  2018-02-01 19:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-02-01 16:58 UTC (permalink / raw)
  To: Guo-Fu Tseng, netdev; +Cc: kernel-janitors, linux-kernel

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

Pointer rxdesc is assigned a value that is never read, it is overwritten
by a new assignment inside a while loop hence the initial assignment
is redundant and can be removed.

Cleans up clang warning:
drivers/net/ethernet/jme.c:1074:17: warning: Value stored to 'rxdesc'
during its initialization is never read

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

diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 62d848df26ef..8a165842fa85 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -1071,7 +1071,7 @@ static int
 jme_process_receive(struct jme_adapter *jme, int limit)
 {
 	struct jme_ring *rxring = &(jme->rxring[0]);
-	struct rxdesc *rxdesc = rxring->desc;
+	struct rxdesc *rxdesc;
 	int i, j, ccnt, desccnt, mask = jme->rx_ring_mask;
 
 	if (unlikely(!atomic_dec_and_test(&jme->rx_cleaning)))
-- 
2.15.1


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

* Re: [PATCH] net: jme: remove unused initialization of 'rxdesc'
  2018-02-01 16:58 [PATCH] net: jme: remove unused initialization of 'rxdesc' Colin King
@ 2018-02-01 19:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-02-01 19:54 UTC (permalink / raw)
  To: colin.king; +Cc: cooldavid, netdev, kernel-janitors, linux-kernel

From: Colin King <colin.king@canonical.com>
Date: Thu,  1 Feb 2018 16:58:42 +0000

> From: Colin Ian King <colin.king@canonical.com>
> 
> Pointer rxdesc is assigned a value that is never read, it is overwritten
> by a new assignment inside a while loop hence the initial assignment
> is redundant and can be removed.
> 
> Cleans up clang warning:
> drivers/net/ethernet/jme.c:1074:17: warning: Value stored to 'rxdesc'
> during its initialization is never read
> 
> 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:[~2018-02-01 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 16:58 [PATCH] net: jme: remove unused initialization of 'rxdesc' Colin King
2018-02-01 19:54 ` 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).