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>
This commit is contained in:

committed by
David S. Miller

parent
ad941e693b
commit
b952f4dff2
@@ -113,7 +113,6 @@ int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb,
|
||||
|
||||
while (offset + sizeof(u16) <= skb->len) {
|
||||
u16 copy_length;
|
||||
unsigned char *data;
|
||||
|
||||
if (!rx->remaining) {
|
||||
if (skb->len - offset == sizeof(u16)) {
|
||||
@@ -167,8 +166,8 @@ int asix_rx_fixup_internal(struct usbnet *dev, struct sk_buff *skb,
|
||||
}
|
||||
|
||||
if (rx->ax_skb) {
|
||||
data = skb_put_data(rx->ax_skb, skb->data + offset,
|
||||
copy_length);
|
||||
skb_put_data(rx->ax_skb, skb->data + offset,
|
||||
copy_length);
|
||||
if (!rx->remaining)
|
||||
usbnet_skb_return(dev, rx->ax_skb);
|
||||
}
|
||||
|
@@ -861,7 +861,6 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
|
||||
unsigned short temp_bytes;
|
||||
unsigned short buffer_offset = 0;
|
||||
unsigned short frame_len;
|
||||
unsigned char *tmp_rx_buf;
|
||||
|
||||
/* log if needed */
|
||||
hso_dbg(0x1, "Rx %d bytes\n", count);
|
||||
@@ -911,9 +910,9 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
|
||||
|
||||
/* Copy what we got so far. make room for iphdr
|
||||
* after tail. */
|
||||
tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
|
||||
(char *)&(odev->rx_ip_hdr),
|
||||
sizeof(struct iphdr));
|
||||
skb_put_data(odev->skb_rx_buf,
|
||||
(char *)&(odev->rx_ip_hdr),
|
||||
sizeof(struct iphdr));
|
||||
|
||||
/* ETH_HLEN */
|
||||
odev->rx_buf_size = sizeof(struct iphdr);
|
||||
@@ -932,9 +931,9 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
|
||||
/* Copy the rest of the bytes that are left in the
|
||||
* buffer into the waiting sk_buf. */
|
||||
/* Make room for temp_bytes after tail. */
|
||||
tmp_rx_buf = skb_put_data(odev->skb_rx_buf,
|
||||
ip_pkt + buffer_offset,
|
||||
temp_bytes);
|
||||
skb_put_data(odev->skb_rx_buf,
|
||||
ip_pkt + buffer_offset,
|
||||
temp_bytes);
|
||||
|
||||
odev->rx_buf_missing -= temp_bytes;
|
||||
count -= temp_bytes;
|
||||
|
Reference in New Issue
Block a user