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

Message ID 539a563bcf649b0dd285934fe8a3d9b24013d2e8.1718204528.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Burakov, Anatoly June 12, 2024, 3 p.m. UTC
From: Ian Stokes <ian.stokes@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@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_switch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

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;