[34/62] common/sfc_efx/base: add named constant for invalid VF

Message ID 1603183709-23420-35-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Superseded, archived
Headers
Series net/sfc: support flow API transfer rules |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Oct. 20, 2020, 8:48 a.m. UTC
  From: Ivan Malov <ivan.malov@oktetlabs.ru>

This makes existing code clearer. Also, it will be used by a later patch.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/common/sfc_efx/base/efx.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h
index 1d2987653b..eefd79dd06 100644
--- a/drivers/common/sfc_efx/base/efx.h
+++ b/drivers/common/sfc_efx/base/efx.h
@@ -1603,11 +1603,13 @@  typedef struct efx_nic_cfg_s {
 	uint32_t		enc_assigned_port;
 } efx_nic_cfg_t;
 
+#define	EFX_PCI_VF_INVALID 0xffff
+
 #define	EFX_VPORT_PCI_FUNCTION_IS_PF(configp) \
-	((configp)->evc_function == 0xffff)
+	((configp)->evc_function == EFX_PCI_VF_INVALID)
 
-#define	EFX_PCI_FUNCTION_IS_PF(_encp)	((_encp)->enc_vf == 0xffff)
-#define	EFX_PCI_FUNCTION_IS_VF(_encp)	((_encp)->enc_vf != 0xffff)
+#define	EFX_PCI_FUNCTION_IS_PF(_encp)	((_encp)->enc_vf == EFX_PCI_VF_INVALID)
+#define	EFX_PCI_FUNCTION_IS_VF(_encp)	((_encp)->enc_vf != EFX_PCI_VF_INVALID)
 
 #define	EFX_PCI_FUNCTION(_encp)	\
 	(EFX_PCI_FUNCTION_IS_PF(_encp) ? (_encp)->enc_pf : (_encp)->enc_vf)
@@ -3871,7 +3873,7 @@  typedef enum efx_vport_type_e {
 #define		EFX_VPORT_ID_INVALID	0
 
 typedef struct efx_vport_config_s {
-	/* Either VF index or 0xffff for PF */
+	/* Either VF index or EFX_PCI_VF_INVALID for PF */
 	uint16_t	evc_function;
 	/* VLAN ID of the associated function */
 	uint16_t	evc_vid;