[PATCH v2 010/148] net/ice/base: fix undefined variables

Anatoly Burakov anatoly.burakov at intel.com
Wed Jun 12 17:00:04 CEST 2024


From: Ian Stokes <ian.stokes at intel.com>

Initialize some variable to avoid "variable might be not defined" warning. This
is due to the fact that for QV, sometimes alternative fragments of code are
being executed exclusively thanks to use of goto, which some compilers cannot
handle correctly.

Signed-off-by: Fabio Pricoco <fabio.pricoco at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 drivers/net/ice/base/ice_switch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 0c13b12faa..fbfc92f294 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -5768,7 +5768,7 @@ ice_cfg_dflt_vsi(struct ice_port_info *pi, u16 vsi_handle, bool set,
 		 u8 direction)
 {
 	struct ice_fltr_list_entry f_list_entry;
-	struct ice_sw_recipe *recp_list;
+	struct ice_sw_recipe *recp_list = NULL;
 	struct ice_fltr_info f_info;
 	struct ice_hw *hw = pi->hw;
 	u8 lport = pi->lport;
@@ -10091,7 +10091,7 @@ int
 ice_replay_vsi_all_fltr(struct ice_hw *hw, struct ice_port_info *pi,
 			u16 vsi_handle)
 {
-	struct ice_switch_info *sw;
+	struct ice_switch_info *sw = NULL;
 	int status;
 	u8 i;
 
-- 
2.43.0



More information about the dev mailing list