diff options
author | yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn> | 2017-06-18 17:52:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-20 20:30:15 +0300 |
commit | b952f4dff2751252db073c27c0f8a16a416a2ddc (patch) | |
tree | fda132505741ee4d859ae09f45966656ea557572 /drivers/net/ethernet | |
parent | ad941e693b24ad8b13c28382d323552ef6fb434b (diff) | |
download | linux-b952f4dff2751252db073c27c0f8a16a416a2ddc.tar.xz |
net: manual clean code which call skb_put_[data:zero]
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/nxp/lpc_eth.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/packetengines/hamachi.c | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index 828bfd93cb54..08381ef8bdb4 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c @@ -919,7 +919,6 @@ static int __lpc_handle_recv(struct net_device *ndev, int budget) struct sk_buff *skb; u32 rxconsidx, len, ethst; struct rx_status_t *prxstat; - u8 *prdbuf; int rx_done = 0; /* Get the current RX buffer indexes */ @@ -960,9 +959,9 @@ static int __lpc_handle_recv(struct net_device *ndev, int budget) ndev->stats.rx_dropped++; } else { /* Copy packet from buffer */ - prdbuf = skb_put_data(skb, - pldat->rx_buff_v + rxconsidx * ENET_MAXF_SIZE, - len); + skb_put_data(skb, + pldat->rx_buff_v + rxconsidx * ENET_MAXF_SIZE, + len); /* Pass to upper layer */ skb->protocol = eth_type_trans(skb, ndev); diff --git a/drivers/net/ethernet/packetengines/hamachi.c b/drivers/net/ethernet/packetengines/hamachi.c index 8b026dbf0d8d..482b85e4d665 100644 --- a/drivers/net/ethernet/packetengines/hamachi.c +++ b/drivers/net/ethernet/packetengines/hamachi.c @@ -1495,8 +1495,8 @@ static int hamachi_rx(struct net_device *dev) hmp->rx_skbuff[entry]->data, pkt_len); skb_put(skb, pkt_len); #else - memcpy(skb_put(skb, pkt_len), hmp->rx_ring_dma - + entry*sizeof(*desc), pkt_len); + skb_put_data(skb, hmp->rx_ring_dma + + entry*sizeof(*desc), pkt_len); #endif pci_dma_sync_single_for_device(hmp->pci_dev, leXX_to_cpu(hmp->rx_ring[entry].addr), |