drivers/net/tg3.c: remove dead code
RFC PATCH 1/1 drivers/net/tg3.c: remove dead code
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(-)
drivers/net/tg3.c renamed from drivers/net/tg3.c.old +5 -13
@@ -2982,7 +2982,6 @@ static int tigon3_4gb_hwbug_workaround(sstruct 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); }
David S. Miller
maintainerQuoted 5 lines · On Tue, 22 Mar 2005 23:02:43 +0100 Adrian Bunk <[email protected]> wrote:
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.
Indeed, 'i' needs to be incremented at the end of the loop basic block.
Good catch.