aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-03-30 15:37:30 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-31 22:26:43 -0400
commit49b44aa23e58d292cc1be79a5c7883ac8c927676 (patch)
tree0317c25f1d20f664d134b92e816e684943f1f7fd
parentb3834acdd78e2b626d576e90c502727da5a46e3c (diff)
ethernet: hisilicon: hns: hns_dsaf_mac: Use generic eth_broadcast_addr
Rather than use an on-stack array to copy a broadcast address, use the generic eth_broadcast_addr function to save a trivial amount of object code. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index cac86e9ae0dd..9dcc5765f11f 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -369,7 +369,6 @@ static int hns_mac_port_config_bc_en(struct hns_mac_cb *mac_cb,
369{ 369{
370 int ret; 370 int ret;
371 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; 371 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev;
372 u8 addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
373 struct dsaf_drv_mac_single_dest_entry mac_entry; 372 struct dsaf_drv_mac_single_dest_entry mac_entry;
374 373
375 /* directy return ok in debug network mode */ 374 /* directy return ok in debug network mode */
@@ -377,7 +376,7 @@ static int hns_mac_port_config_bc_en(struct hns_mac_cb *mac_cb,
377 return 0; 376 return 0;
378 377
379 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { 378 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) {
380 memcpy(mac_entry.addr, addr, sizeof(mac_entry.addr)); 379 eth_broadcast_addr(mac_entry.addr);
381 mac_entry.in_vlan_id = vlan_id; 380 mac_entry.in_vlan_id = vlan_id;
382 mac_entry.in_port_num = mac_cb->mac_id; 381 mac_entry.in_port_num = mac_cb->mac_id;
383 mac_entry.port_num = port_num; 382 mac_entry.port_num = port_num;
@@ -404,7 +403,6 @@ int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vmid, bool enable)
404 int ret; 403 int ret;
405 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev; 404 struct dsaf_device *dsaf_dev = mac_cb->dsaf_dev;
406 u8 port_num; 405 u8 port_num;
407 u8 addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
408 struct mac_entry_idx *uc_mac_entry; 406 struct mac_entry_idx *uc_mac_entry;
409 struct dsaf_drv_mac_single_dest_entry mac_entry; 407 struct dsaf_drv_mac_single_dest_entry mac_entry;
410 408
@@ -414,7 +412,7 @@ int hns_mac_vm_config_bc_en(struct hns_mac_cb *mac_cb, u32 vmid, bool enable)
414 uc_mac_entry = &mac_cb->addr_entry_idx[vmid]; 412 uc_mac_entry = &mac_cb->addr_entry_idx[vmid];
415 413
416 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) { 414 if (!HNS_DSAF_IS_DEBUG(dsaf_dev)) {
417 memcpy(mac_entry.addr, addr, sizeof(mac_entry.addr)); 415 eth_broadcast_addr(mac_entry.addr);
418 mac_entry.in_vlan_id = uc_mac_entry->vlan_id; 416 mac_entry.in_vlan_id = uc_mac_entry->vlan_id;
419 mac_entry.in_port_num = mac_cb->mac_id; 417 mac_entry.in_port_num = mac_cb->mac_id;
420 ret = hns_mac_get_inner_port_num(mac_cb, vmid, &port_num); 418 ret = hns_mac_get_inner_port_num(mac_cb, vmid, &port_num);