summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ice/ice_vf_lib.h
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2022-02-22 16:27:06 -0800
committerTony Nguyen <anthony.l.nguyen@intel.com>2022-03-15 13:22:49 -0700
commit4fe193cc9dd09565b61de2bf3dd62924443929dd (patch)
treec7d77359433dae131ce3d69fdbe3112e4baedfed /drivers/net/ethernet/intel/ice/ice_vf_lib.h
parentfe99d1c06c16b8a97d844a3554f67f601abeb738 (diff)
downloadlinux-4fe193cc9dd09565b61de2bf3dd62924443929dd.tar.gz
linux-4fe193cc9dd09565b61de2bf3dd62924443929dd.tar.bz2
linux-4fe193cc9dd09565b61de2bf3dd62924443929dd.zip
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@intel.com> Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_vf_lib.h')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_vf_lib.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
index f7906111aeb3..811b6cc8ad67 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h
@@ -212,7 +212,7 @@ int
ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m);
int
ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m);
-bool ice_reset_vf(struct ice_vf *vf, bool is_vflr);
+int ice_reset_vf(struct ice_vf *vf, bool is_vflr);
void ice_reset_all_vfs(struct ice_pf *pf);
#else /* CONFIG_PCI_IOV */
static inline struct ice_vf *ice_get_vf_by_id(struct ice_pf *pf, u16 vf_id)
@@ -270,9 +270,9 @@ ice_vf_clear_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m)
return -EOPNOTSUPP;
}
-static inline bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)
+static inline int ice_reset_vf(struct ice_vf *vf, bool is_vflr)
{
- return true;
+ return 0;
}
static inline void ice_reset_all_vfs(struct ice_pf *pf)