diff options
author | David S. Miller <davem@davemloft.net> | 2005-06-28 18:25:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-28 18:25:31 -0400 |
commit | 689be43945e9ca7dd704522e55af1b8a73a994d3 (patch) | |
tree | 6dcc7a5675a9a2b98c36ee54f2ba4386f84efe83 /drivers/net/tulip/interrupt.c | |
parent | f835e471b557c45d2e5701ea5215f6e739b4eb39 (diff) |
[NET]: Remove gratuitous use of skb->tail in network drivers.
Many drivers use skb->tail unnecessarily.
In these situations, the code roughly looks like:
dev = dev_alloc_skb(...);
[optional] skb_reserve(skb, ...);
... skb->tail ...
But even if the skb_reserve() happens, skb->data equals
skb->tail. So it doesn't make any sense to use anything
other than skb->data in these cases.
Another case was the s2io.c driver directly mucking with
the skb->data and skb->tail pointers. It really just wanted
to do an skb_reserve(), so that's what the code was changed
to do instead.
Another reason I'm making this change as it allows some SKB
cleanups I have planned simpler to merge. In those cleanups,
skb->head, skb->tail, and skb->end pointers are removed, and
replaced with skb->head_room and skb->tail_room integers.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/tulip/interrupt.c')
-rw-r--r-- | drivers/net/tulip/interrupt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index afb5cda9d8e1..bb3558164a5b 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c | |||
@@ -78,7 +78,7 @@ int tulip_refill_rx(struct net_device *dev) | |||
78 | if (skb == NULL) | 78 | if (skb == NULL) |
79 | break; | 79 | break; |
80 | 80 | ||
81 | mapping = pci_map_single(tp->pdev, skb->tail, PKT_BUF_SZ, | 81 | mapping = pci_map_single(tp->pdev, skb->data, PKT_BUF_SZ, |
82 | PCI_DMA_FROMDEVICE); | 82 | PCI_DMA_FROMDEVICE); |
83 | tp->rx_buffers[entry].mapping = mapping; | 83 | tp->rx_buffers[entry].mapping = mapping; |
84 | 84 | ||
@@ -199,12 +199,12 @@ int tulip_poll(struct net_device *dev, int *budget) | |||
199 | tp->rx_buffers[entry].mapping, | 199 | tp->rx_buffers[entry].mapping, |
200 | pkt_len, PCI_DMA_FROMDEVICE); | 200 | pkt_len, PCI_DMA_FROMDEVICE); |
201 | #if ! defined(__alpha__) | 201 | #if ! defined(__alpha__) |
202 | eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->tail, | 202 | eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->data, |
203 | pkt_len, 0); | 203 | pkt_len, 0); |
204 | skb_put(skb, pkt_len); | 204 | skb_put(skb, pkt_len); |
205 | #else | 205 | #else |
206 | memcpy(skb_put(skb, pkt_len), | 206 | memcpy(skb_put(skb, pkt_len), |
207 | tp->rx_buffers[entry].skb->tail, | 207 | tp->rx_buffers[entry].skb->data, |
208 | pkt_len); | 208 | pkt_len); |
209 | #endif | 209 | #endif |
210 | pci_dma_sync_single_for_device(tp->pdev, | 210 | pci_dma_sync_single_for_device(tp->pdev, |
@@ -423,12 +423,12 @@ static int tulip_rx(struct net_device *dev) | |||
423 | tp->rx_buffers[entry].mapping, | 423 | tp->rx_buffers[entry].mapping, |
424 | pkt_len, PCI_DMA_FROMDEVICE); | 424 | pkt_len, PCI_DMA_FROMDEVICE); |
425 | #if ! defined(__alpha__) | 425 | #if ! defined(__alpha__) |
426 | eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->tail, | 426 | eth_copy_and_sum(skb, tp->rx_buffers[entry].skb->data, |
427 | pkt_len, 0); | 427 | pkt_len, 0); |
428 | skb_put(skb, pkt_len); | 428 | skb_put(skb, pkt_len); |
429 | #else | 429 | #else |
430 | memcpy(skb_put(skb, pkt_len), | 430 | memcpy(skb_put(skb, pkt_len), |
431 | tp->rx_buffers[entry].skb->tail, | 431 | tp->rx_buffers[entry].skb->data, |
432 | pkt_len); | 432 | pkt_len); |
433 | #endif | 433 | #endif |
434 | pci_dma_sync_single_for_device(tp->pdev, | 434 | pci_dma_sync_single_for_device(tp->pdev, |