i40e: refactor promisc_changed in i40e_sync_vsi_filters
authorAlan Brady <alan.brady@intel.com>
Mon, 22 Jan 2018 17:00:35 +0000 (12:00 -0500)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 13 Feb 2018 19:40:10 +0000 (11:40 -0800)
commitcc6a96a41991de1961cfd712a83df21456607d30
tree7820cb4c9018a90ad2bd45360344c08c038b9c41
parentfbd5eb54c28ce314e0cca1505d2261a8a84ebc44
i40e: refactor promisc_changed in i40e_sync_vsi_filters

This code here is quite complex and easy to screw up.  Let's see if we
can't improve the readability and maintainability a bit.  This refactors
out promisc_changed into two variables 'old_overflow' and 'new_overflow'
which makes it a bit clearer when we're concerned about when and how
overflow promiscuous is changed.  This also makes so that we no longer
need to pass a boolean pointer to i40e_aqc_add_filters.  Instead we can
simply check if we changed the overflow promiscuous flag since the
function start.

Signed-off-by: Alan Brady <alan.brady@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c