Skip to content

Commit

Permalink
[PATCH] AT91RM9200 Ethernet: Use dev_alloc_skb()
Browse files Browse the repository at this point in the history
Use dev_alloc_skb() instead of alloc_skb().

It is also not necessary to adjust skb->len manually since that's
already done by skb_put().

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Andrew Victor authored and Jeff Garzik committed Dec 7, 2006
1 parent 51cc210 commit a3f63e4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/arm/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,14 +853,13 @@ static void at91ether_rx(struct net_device *dev)
while (dlist->descriptors[lp->rxBuffIndex].addr & EMAC_DESC_DONE) {
p_recv = dlist->recv_buf[lp->rxBuffIndex];
pktlen = dlist->descriptors[lp->rxBuffIndex].size & 0x7ff; /* Length of frame including FCS */
skb = alloc_skb(pktlen + 2, GFP_ATOMIC);
skb = dev_alloc_skb(pktlen + 2);
if (skb != NULL) {
skb_reserve(skb, 2);
memcpy(skb_put(skb, pktlen), p_recv, pktlen);

skb->dev = dev;
skb->protocol = eth_type_trans(skb, dev);
skb->len = pktlen;
dev->last_rx = jiffies;
lp->stats.rx_bytes += pktlen;
netif_rx(skb);
Expand Down

0 comments on commit a3f63e4

Please sign in to comment.