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/82596.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/82596.c')
-rw-r--r-- | drivers/net/82596.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/82596.c b/drivers/net/82596.c index 65f97b1dc581..13b745b39667 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c | |||
@@ -546,11 +546,11 @@ static inline void init_rx_bufs(struct net_device *dev) | |||
546 | rbd->b_next = WSWAPrbd(virt_to_bus(rbd+1)); | 546 | rbd->b_next = WSWAPrbd(virt_to_bus(rbd+1)); |
547 | rbd->b_addr = WSWAPrbd(virt_to_bus(rbd)); | 547 | rbd->b_addr = WSWAPrbd(virt_to_bus(rbd)); |
548 | rbd->skb = skb; | 548 | rbd->skb = skb; |
549 | rbd->v_data = skb->tail; | 549 | rbd->v_data = skb->data; |
550 | rbd->b_data = WSWAPchar(virt_to_bus(skb->tail)); | 550 | rbd->b_data = WSWAPchar(virt_to_bus(skb->data)); |
551 | rbd->size = PKT_BUF_SZ; | 551 | rbd->size = PKT_BUF_SZ; |
552 | #ifdef __mc68000__ | 552 | #ifdef __mc68000__ |
553 | cache_clear(virt_to_phys(skb->tail), PKT_BUF_SZ); | 553 | cache_clear(virt_to_phys(skb->data), PKT_BUF_SZ); |
554 | #endif | 554 | #endif |
555 | } | 555 | } |
556 | lp->rbd_head = lp->rbds; | 556 | lp->rbd_head = lp->rbds; |
@@ -816,10 +816,10 @@ static inline int i596_rx(struct net_device *dev) | |||
816 | rx_in_place = 1; | 816 | rx_in_place = 1; |
817 | rbd->skb = newskb; | 817 | rbd->skb = newskb; |
818 | newskb->dev = dev; | 818 | newskb->dev = dev; |
819 | rbd->v_data = newskb->tail; | 819 | rbd->v_data = newskb->data; |
820 | rbd->b_data = WSWAPchar(virt_to_bus(newskb->tail)); | 820 | rbd->b_data = WSWAPchar(virt_to_bus(newskb->data)); |
821 | #ifdef __mc68000__ | 821 | #ifdef __mc68000__ |
822 | cache_clear(virt_to_phys(newskb->tail), PKT_BUF_SZ); | 822 | cache_clear(virt_to_phys(newskb->data), PKT_BUF_SZ); |
823 | #endif | 823 | #endif |
824 | } | 824 | } |
825 | else | 825 | else |
@@ -840,7 +840,7 @@ memory_squeeze: | |||
840 | skb->protocol=eth_type_trans(skb,dev); | 840 | skb->protocol=eth_type_trans(skb,dev); |
841 | skb->len = pkt_len; | 841 | skb->len = pkt_len; |
842 | #ifdef __mc68000__ | 842 | #ifdef __mc68000__ |
843 | cache_clear(virt_to_phys(rbd->skb->tail), | 843 | cache_clear(virt_to_phys(rbd->skb->data), |
844 | pkt_len); | 844 | pkt_len); |
845 | #endif | 845 | #endif |
846 | netif_rx(skb); | 846 | netif_rx(skb); |