Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlx4: use reset to set mac header

Since offset is zero, it's not necessary to use set function. Reset
function is straightforward, and will remove the unnecessary add
operation in set function.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Zhang Shengju and committed by
David S. Miller
69029109 0e24c0ad

+1 -1
+1 -1
drivers/net/ethernet/mellanox/mlx4/en_selftest.c
··· 68 68 memcpy(ethh->h_dest, priv->dev->dev_addr, ETH_ALEN); 69 69 eth_zero_addr(ethh->h_source); 70 70 ethh->h_proto = htons(ETH_P_ARP); 71 - skb_set_mac_header(skb, 0); 71 + skb_reset_mac_header(skb); 72 72 for (i = 0; i < packet_size; ++i) /* fill our packet */ 73 73 packet[i] = (unsigned char)(i & 0xff); 74 74