summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/apple
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-06-13 14:28:18 +0200
committerDavid S. Miller <davem@davemloft.net>2017-06-13 13:54:03 -0400
commitaa9f979c41043d9fcf7957c99948e20bbddefc7f (patch)
tree121013b5d9c5ae6189070a7bb9f7d209962e4a22 /drivers/net/ethernet/apple
parent0e74008b668febb7ae024c7ee04b30dcbd1f1efd (diff)
downloadlinux-aa9f979c41043d9fcf7957c99948e20bbddefc7f.tar.bz2
networking: use skb_put_zero()
Use the recently introduced helper to replace the pattern of skb_put() && memset(), this transformation was done with the following spatch: @@ identifier p; expression len; expression skb; @@ -p = skb_put(skb, len); -memset(p, 0, len); +p = skb_put_zero(skb, len); Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/apple')
-rw-r--r--drivers/net/ethernet/apple/bmac.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/apple/bmac.c b/drivers/net/ethernet/apple/bmac.c
index 2b2d87089987..eac740c476ce 100644
--- a/drivers/net/ethernet/apple/bmac.c
+++ b/drivers/net/ethernet/apple/bmac.c
@@ -1218,8 +1218,7 @@ static void bmac_reset_and_enable(struct net_device *dev)
*/
skb = netdev_alloc_skb(dev, ETHERMINPACKET);
if (skb != NULL) {
- data = skb_put(skb, ETHERMINPACKET);
- memset(data, 0, ETHERMINPACKET);
+ data = skb_put_zero(skb, ETHERMINPACKET);
memcpy(data, dev->dev_addr, ETH_ALEN);
memcpy(data + ETH_ALEN, dev->dev_addr, ETH_ALEN);
bmac_transmit_packet(skb, dev);