ice: Change ice_vsi_realloc_stat_arrays() to void
Subsystems (2)
Tony Nguyen
maintainerPATCH 1/1 ice: Change ice_vsi_realloc_stat_arrays() to void
smatch reports:
smatch warnings:drivers/net/ethernet/intel/ice/ice_lib.c:3612 ice_vsi_rebuild() warn: missing error code 'ret'
If an error is encountered for ice_vsi_realloc_stat_arrays(), ret is not assigned an error value so the goto error path would return success. The function, however, only returns 0 so an error will never be reported; due to this, change the function to return void.
--- drivers/net/ethernet/intel/ice/ice_lib.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/ice/ice_lib.c +4 -7
@@ -3439,7 +3439,7 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,* @prev_txq: Number of Tx rings before ring reallocation * @prev_rxq: Number of Rx rings before ring reallocation */ -static int +static void ice_vsi_realloc_stat_arrays (struct ice_vsi *vsi,int prev_txq,int prev_rxq) {struct ice_vsi_stats *vsi_stat;
@@ -3447,9 +3447,9 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi, int prev_txq, int prev_rxq)int i;if (!prev_txq || !prev_rxq) -return 0 ; +return ;if (vsi->type ==ICE_VSI_CHNL ) -return 0 ; +return ; vsi_stat = pf->vsi_stats[vsi->idx];
@@ -3470,8 +3470,6 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi, int prev_txq, int prev_rxq) } } } - -return 0 ; }/**
@@ -3521,8 +3519,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, int init_vsi) } } -if (ice_vsi_realloc_stat_arrays (vsi, prev_txq, prev_rxq)) - goto err_vsi_cfg_tc_lan; +ice_vsi_realloc_stat_arrays (vsi, prev_txq, prev_rxq);ice_vsi_rebuild_set_coalesce (vsi, coalesce, prev_num_q_vectors);kfree (coalesce);
Signature · 6 lines
2.35.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 23 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: Friday, January 6, 2023 1:03 AM
To: [email protected]; Mikailenko, Benjamin <[email protected]>
Cc: Nguyen, Anthony L <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next] ice: Changeice_vsi_realloc_stat_arrays()to voidsmatch reports:
smatch warnings:
drivers/net/ethernet/intel/ice/ice_lib.c:3612ice_vsi_rebuild()warn: missing error code 'ret'If an error is encountered for
ice_vsi_realloc_stat_arrays(), ret is not assigned an error value so the goto error path would return success. The function, however, only returns 0 so an error will never be reported; due to this, change the function to return void.
Quoted 6 lines
Reported-by kernel test robot <[email protected]>Signed-off-by Tony Nguyen <[email protected]>--- drivers/net/ethernet/intel/ice/ice_lib.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan