Skip to content

Commit

Permalink
net: usb: Use eth_<foo>_addr instead of memset
Browse files Browse the repository at this point in the history
Use the built-in function instead of memset.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed Mar 3, 2015
1 parent c7bf716 commit 519983b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static void catc_set_multicast_list(struct net_device *netdev)
u8 broadcast[ETH_ALEN];
u8 rx = RxEnable | RxPolarity | RxMultiCast;

memset(broadcast, 0xff, ETH_ALEN);
eth_broadcast_addr(broadcast);
memset(catc->multicast, 0, 64);

catc_multicast(broadcast, catc->multicast);
Expand Down Expand Up @@ -880,7 +880,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id

dev_dbg(dev, "Filling the multicast list.\n");

memset(broadcast, 0xff, ETH_ALEN);
eth_broadcast_addr(broadcast);
catc_multicast(broadcast, catc->multicast);
catc_multicast(netdev->dev_addr, catc->multicast);
catc_write_mem(catc, 0xfa80, catc->multicast, 64);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/cdc_mbim.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ static struct sk_buff *cdc_mbim_process_dgram(struct usbnet *dev, u8 *buf, size_
skb_put(skb, ETH_HLEN);
skb_reset_mac_header(skb);
eth_hdr(skb)->h_proto = proto;
memset(eth_hdr(skb)->h_source, 0, ETH_ALEN);
eth_zero_addr(eth_hdr(skb)->h_source);
memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);

/* add datagram */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/lg-vl600.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
&buf->data[sizeof(*ethhdr) + 0x12],
ETH_ALEN);
} else {
memset(ethhdr->h_source, 0, ETH_ALEN);
eth_zero_addr(ethhdr->h_source);
memcpy(ethhdr->h_dest, dev->net->dev_addr, ETH_ALEN);

/* Inbound IPv6 packets have an IPv4 ethertype (0x800)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/qmi_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
skb_push(skb, ETH_HLEN);
skb_reset_mac_header(skb);
eth_hdr(skb)->h_proto = proto;
memset(eth_hdr(skb)->h_source, 0, ETH_ALEN);
eth_zero_addr(eth_hdr(skb)->h_source);
fix_dest:
memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
return 1;
Expand Down

0 comments on commit 519983b

Please sign in to comment.