[RFC: 2.6 patch] drivers/net/tg3.c: remove dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

---

 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);
 	}
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux