diff mbox series

[v5,07/30] net/ice/base: remove pointless NULL check of port info

Message ID 20190923074448.7847-8-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers show
Series net/ice/base: share code update secend batch. | expand


Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Zhang, Qi Z Sept. 23, 2019, 7:44 a.m. UTC
The code in ice_sched_cleanup_all checks whether the port info is NULL
prior to calling ice_sched_clear_port.

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>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
 drivers/net/ice/base/ice_sched.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series


diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index 6732e291a..553fc28ff 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -840,8 +840,7 @@  void ice_sched_cleanup_all(struct ice_hw *hw)
 		hw->layer_info = NULL;
-	if (hw->port_info)
-		ice_sched_clear_port(hw->port_info);
+	ice_sched_clear_port(hw->port_info);
 	hw->num_tx_sched_layers = 0;
 	hw->num_tx_sched_phys_layers = 0;