Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7bf7169 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

ethernet: Use eth_<foo>_addr instead of memset



Use the built-in function instead of memset.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e8ab38cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1708,7 +1708,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)

	/* if the ethernet address is not valid, force to 00:00:00:00:00:00 */
	if (!is_valid_ether_addr(dev->dev_addr))
		memset(dev->dev_addr, 0, ETH_ALEN);
		eth_zero_addr(dev->dev_addr);

	if (pcnet32_debug & NETIF_MSG_PROBE) {
		pr_cont(" %pM", dev->dev_addr);
+1 −1
Original line number Diff line number Diff line
@@ -2446,7 +2446,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode)
	}
	packet = skb_put(skb, pkt_size);
	memcpy(packet, bp->dev->dev_addr, ETH_ALEN);
	memset(packet + ETH_ALEN, 0, ETH_ALEN);
	eth_zero_addr(packet + ETH_ALEN);
	memset(packet + 2*ETH_ALEN, 0x77, (ETH_HLEN - 2*ETH_ALEN));
	for (i = ETH_HLEN; i < pkt_size; i++)
		packet[i] = (unsigned char) (i & 0xff);
+3 −3
Original line number Diff line number Diff line
@@ -11546,13 +11546,13 @@ static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp)
	/* Disable iSCSI OOO if MAC configuration is invalid. */
	if (!is_valid_ether_addr(iscsi_mac)) {
		bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
		memset(iscsi_mac, 0, ETH_ALEN);
		eth_zero_addr(iscsi_mac);
	}

	/* Disable FCoE if MAC configuration is invalid. */
	if (!is_valid_ether_addr(fip_mac)) {
		bp->flags |= NO_FCOE_FLAG;
		memset(bp->fip_mac, 0, ETH_ALEN);
		eth_zero_addr(bp->fip_mac);
	}
}

@@ -11563,7 +11563,7 @@ static void bnx2x_get_mac_hwinfo(struct bnx2x *bp)
	int port = BP_PORT(bp);

	/* Zero primary MAC configuration */
	memset(bp->dev->dev_addr, 0, ETH_ALEN);
	eth_zero_addr(bp->dev->dev_addr);

	if (BP_NOMCP(bp)) {
		BNX2X_ERROR("warning: random MAC workaround active\n");
+1 −1
Original line number Diff line number Diff line
@@ -2693,7 +2693,7 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,
			memcpy(&ivi->mac, bulletin->mac, ETH_ALEN);
		else
			/* function has not been loaded yet. Show mac as 0s */
			memset(&ivi->mac, 0, ETH_ALEN);
			eth_zero_addr(ivi->mac);

		/* vlan */
		if (bulletin->valid_bitmap & (1 << VLAN_VALID))
+4 −4
Original line number Diff line number Diff line
@@ -893,7 +893,7 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
		} else {
			memset(pp, 0, sizeof(*pp));
			if (vf == PORT_SELF_VF)
				memset(netdev->dev_addr, 0, ETH_ALEN);
				eth_zero_addr(netdev->dev_addr);
		}
	} else {
		/* Set flag to indicate that the port assoc/disassoc
@@ -903,14 +903,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,

		/* If DISASSOCIATE, clean up all assigned/saved macaddresses */
		if (pp->request == PORT_REQUEST_DISASSOCIATE) {
			memset(pp->mac_addr, 0, ETH_ALEN);
			eth_zero_addr(pp->mac_addr);
			if (vf == PORT_SELF_VF)
				memset(netdev->dev_addr, 0, ETH_ALEN);
				eth_zero_addr(netdev->dev_addr);
		}
	}

	if (vf == PORT_SELF_VF)
		memset(pp->vf_mac, 0, ETH_ALEN);
		eth_zero_addr(pp->vf_mac);

	return err;
}
Loading