Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: remove pointless NULL check of port_info

The code in ice_sched_cleanup_all checks whether the port info is NULL
prior to calling ice_sched_clear_port. However, ice_sched_clear_port
already checks whether port info is non-NULL.

More importantly, it also checks whether the port structure has been
initialized by checking its port_state field as well.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Jacob Keller and committed by
Jeff Kirsher
1748ce80 87324e74

+1 -2
+1 -2
drivers/net/ethernet/intel/ice/ice_sched.c
··· 798 798 hw->layer_info = NULL; 799 799 } 800 800 801 - if (hw->port_info) 802 - ice_sched_clear_port(hw->port_info); 801 + ice_sched_clear_port(hw->port_info); 803 802 804 803 hw->num_tx_sched_layers = 0; 805 804 hw->num_tx_sched_phys_layers = 0;