1
0
mirror of https://github.com/corundum/corundum.git synced 2025-02-06 08:38:23 +08:00

Use ETH_ALEN

This commit is contained in:
Alex Forencich 2021-02-01 21:53:38 -08:00
parent 6b142d36c2
commit 9f970b1556

View File

@ -102,7 +102,7 @@ static int read_mac_from_eeprom(struct mqnic_dev *mqnic, struct i2c_client *eepr
return -1; return -1;
} }
ret = i2c_smbus_read_i2c_block_data(eeprom, offset, 6, mac); ret = i2c_smbus_read_i2c_block_data(eeprom, offset, ETH_ALEN, mac);
if (ret < 0) if (ret < 0)
{ {
dev_warn(mqnic->dev, "Failed to read MAC from EEPROM"); dev_warn(mqnic->dev, "Failed to read MAC from EEPROM");
@ -114,10 +114,8 @@ static int read_mac_from_eeprom(struct mqnic_dev *mqnic, struct i2c_client *eepr
static int init_mac_list_from_eeprom_base(struct mqnic_dev *mqnic, struct i2c_client *eeprom, int offset, int count) static int init_mac_list_from_eeprom_base(struct mqnic_dev *mqnic, struct i2c_client *eeprom, int offset, int count)
{ {
int ret, k; int ret;
char mac[6]; char mac[ETH_ALEN];
count = min(count, MQNIC_MAX_IF);
ret = read_mac_from_eeprom(mqnic, eeprom, offset, mac); ret = read_mac_from_eeprom(mqnic, eeprom, offset, mac);
if (ret < 0) if (ret < 0)