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/pcnet32.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/pcnet32.c')
-rw-r--r-- | drivers/net/pcnet32.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 3213f3e50487..113b68099216 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -1602,7 +1602,7 @@ pcnet32_init_ring(struct net_device *dev) | |||
1602 | 1602 | ||
1603 | rmb(); | 1603 | rmb(); |
1604 | if (lp->rx_dma_addr[i] == 0) | 1604 | if (lp->rx_dma_addr[i] == 0) |
1605 | lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, | 1605 | lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->data, |
1606 | PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); | 1606 | PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); |
1607 | lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); | 1607 | lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); |
1608 | lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); | 1608 | lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); |
@@ -1983,7 +1983,7 @@ pcnet32_rx(struct net_device *dev) | |||
1983 | lp->rx_skbuff[entry] = newskb; | 1983 | lp->rx_skbuff[entry] = newskb; |
1984 | newskb->dev = dev; | 1984 | newskb->dev = dev; |
1985 | lp->rx_dma_addr[entry] = | 1985 | lp->rx_dma_addr[entry] = |
1986 | pci_map_single(lp->pci_dev, newskb->tail, | 1986 | pci_map_single(lp->pci_dev, newskb->data, |
1987 | PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); | 1987 | PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); |
1988 | lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); | 1988 | lp->rx_ring[entry].base = le32_to_cpu(lp->rx_dma_addr[entry]); |
1989 | rx_in_place = 1; | 1989 | rx_in_place = 1; |
@@ -2020,7 +2020,7 @@ pcnet32_rx(struct net_device *dev) | |||
2020 | PKT_BUF_SZ-2, | 2020 | PKT_BUF_SZ-2, |
2021 | PCI_DMA_FROMDEVICE); | 2021 | PCI_DMA_FROMDEVICE); |
2022 | eth_copy_and_sum(skb, | 2022 | eth_copy_and_sum(skb, |
2023 | (unsigned char *)(lp->rx_skbuff[entry]->tail), | 2023 | (unsigned char *)(lp->rx_skbuff[entry]->data), |
2024 | pkt_len,0); | 2024 | pkt_len,0); |
2025 | pci_dma_sync_single_for_device(lp->pci_dev, | 2025 | pci_dma_sync_single_for_device(lp->pci_dev, |
2026 | lp->rx_dma_addr[entry], | 2026 | lp->rx_dma_addr[entry], |