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>
err = igc_add_mac_steering_filter(adapter,
input->filter.dst_addr,
input->action, 0);
- err = min_t(int, err, 0);
if (err)
return err;
}
input->filter.src_addr,
input->action,
IGC_MAC_STATE_SRC_ADDR);
- err = min_t(int, err, 0);
if (err)
return err;
}
adapter->mac_table[i].state |= IGC_MAC_STATE_IN_USE | flags;
igc_rar_set_index(adapter, i);
- return i;
+ return 0;
}
return -ENOSPC;
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)