summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igc/igc_main.c
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@intel.com>2020-03-18 16:00:53 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2020-04-19 11:46:47 -0700
commit58184b8ff0786b219772016a50ce07c6b3020846 (patch)
treeb53943b0771e52b90f98b2d78b40b0b385e80a29 /drivers/net/ethernet/intel/igc/igc_main.c
parent23b7b511675669702ad32bf7f92dcf2ae05015ba (diff)
igc: Change igc_add_mac_filter() returning value
In case of success, igc_add_mac_filter() returns the index in adapter->mac_table where the requested filter was added. This information, however, is not used by any caller of that function. In fact, callers have extra code just to handle this returning index as 0 (success). So this patch changes the function to return 0 on success instead, and cleans up the extra code. Signed-off-by: Andre Guedes <andre.guedes@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 66b3a689bb05..7c060c731a7e 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -2217,7 +2217,7 @@ static int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,
adapter->mac_table[i].state |= IGC_MAC_STATE_IN_USE | flags;
igc_rar_set_index(adapter, i);
- return i;
+ return 0;
}
return -ENOSPC;
@@ -2276,11 +2276,8 @@ static int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,
static int igc_uc_sync(struct net_device *netdev, const unsigned char *addr)
{
struct igc_adapter *adapter = netdev_priv(netdev);
- int ret;
-
- ret = igc_add_mac_filter(adapter, addr, adapter->num_rx_queues, 0);
- return min_t(int, ret, 0);
+ return igc_add_mac_filter(adapter, addr, adapter->num_rx_queues, 0);
}
static int igc_uc_unsync(struct net_device *netdev, const unsigned char *addr)