All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: davem@davemloft.net, jgarzik@pobox.com
Cc: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org
Subject: [RFC: 2.6 patch] drivers/net/tg3.c: remove dead code
Date: Tue, 22 Mar 2005 23:02:43 +0100	[thread overview]
Message-ID: <20050322220243.GQ1948@stusta.de> (raw)

The Coverity checker discovered that i never gets any value different 
from 0 assigned.

I do not claim that this patch is correct, but if it isn't correct the 
bug is that i never gets assigned any value.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 drivers/net/tg3.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

--- linux-2.6.12-rc1-mm1-full/drivers/net/tg3.c.old	2005-03-22 21:34:55.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/net/tg3.c	2005-03-22 22:08:40.000000000 +0100
@@ -2982,7 +2982,6 @@ static int tigon3_4gb_hwbug_workaround(s
 	struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC);
 	dma_addr_t new_addr;
 	u32 entry = *start;
-	int i;
 
 	if (!new_skb) {
 		dev_kfree_skb(skb);
@@ -2999,23 +2998,16 @@ static int tigon3_4gb_hwbug_workaround(s
 	*start = NEXT_TX(entry);
 
 	/* Now clean up the sw ring entries. */
-	i = 0;
 	while (entry != last_plus_one) {
-		int len;
+		int len = skb_headlen(skb);
 
-		if (i == 0)
-			len = skb_headlen(skb);
-		else
-			len = skb_shinfo(skb)->frags[i-1].size;
 		pci_unmap_single(tp->pdev,
 				 pci_unmap_addr(&tp->tx_buffers[entry], mapping),
 				 len, PCI_DMA_TODEVICE);
-		if (i == 0) {
-			tp->tx_buffers[entry].skb = new_skb;
-			pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, new_addr);
-		} else {
-			tp->tx_buffers[entry].skb = NULL;
-		}
+
+		tp->tx_buffers[entry].skb = new_skb;
+		pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, new_addr);
+
 		entry = NEXT_TX(entry);
 	}
 


             reply	other threads:[~2005-03-22 22:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 22:02 Adrian Bunk [this message]
2005-03-22 22:08 ` [RFC: 2.6 patch] drivers/net/tg3.c: remove dead code David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050322220243.GQ1948@stusta.de \
    --to=bunk@stusta.de \
    --cc=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.