[Intel-wired-lan] [net-next PATCH 19/25] ice: convert ice_reset_vf to standard error codes

Jankowski, Konrad0 konrad0.jankowski at intel.com
Wed Mar 2 19:46:29 UTC 2022



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of
> Jacob Keller
> Sent: Wednesday, February 23, 2022 1:27 AM
> To: Intel Wired LAN <intel-wired-lan at lists.osuosl.org>
> Subject: [Intel-wired-lan] [net-next PATCH 19/25] ice: convert ice_reset_vf
> to standard error codes
> 
> The ice_reset_vf function returns a boolean value indicating whether or not
> the VF reset. This is a bit confusing since it means that callers need to know
> how to interpret the return value when needing to indicate an error.
> 
> Refactor the function and call sites to report a regular error code. We still
> report success (i.e. return 0) in cases where the reset is in progress or is
> disabled.
> 
> Existing callers don't care because they do not check the return value.
> We keep the error code anyways instead of a void return because we expect
> future code which may care about or at least report the error value.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_vf_lib.c | 15 ++++++++-------
> drivers/net/ethernet/intel/ice/ice_vf_lib.h |  6 +++---
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> index 6f9e8383c69b..d37232197bde 100644
> --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
> @@ -446,10 +446,11 @@ void ice_reset_all_vfs(struct ice_pf *pf)

Tested-by: Konrad Jankowski <konrad0.jankowski at intel.com>


More information about the Intel-wired-lan mailing list