[v3,09/11] net/nfp: rename some parameter and variable

Message ID 20231013060653.1006410-10-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Unify the PMD coding style |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Oct. 13, 2023, 6:06 a.m. UTC
  Rename some parameter and variable to make the logic easier to
understand.
Also avoid the mix use of lowercase and uppercase in macro name.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_common.h    | 20 ++++++++++----------
 drivers/net/nfp/nfp_ethdev_vf.c |  8 ++++----
 2 files changed, 14 insertions(+), 14 deletions(-)
  

Patch

diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h
index cd0ca50c6b..aad3c29ba8 100644
--- a/drivers/net/nfp/nfp_common.h
+++ b/drivers/net/nfp/nfp_common.h
@@ -19,9 +19,9 @@ 
 #define NFP_QCP_QUEUE_ADD_RPTR                  0x0000
 #define NFP_QCP_QUEUE_ADD_WPTR                  0x0004
 #define NFP_QCP_QUEUE_STS_LO                    0x0008
-#define NFP_QCP_QUEUE_STS_LO_READPTR_mask     (0x3ffff)
+#define NFP_QCP_QUEUE_STS_LO_READPTR_MASK     (0x3ffff)
 #define NFP_QCP_QUEUE_STS_HI                    0x000c
-#define NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask    (0x3ffff)
+#define NFP_QCP_QUEUE_STS_HI_WRITEPTR_MASK    (0x3ffff)
 
 /* Interrupt definitions */
 #define NFP_NET_IRQ_LSC_IDX             0
@@ -303,7 +303,7 @@  nn_cfg_writeq(struct nfp_net_hw *hw,
 /**
  * Add the value to the selected pointer of a queue.
  *
- * @param q
+ * @param queue
  *   Base address for queue structure
  * @param ptr
  *   Add to the read or write pointer
@@ -311,7 +311,7 @@  nn_cfg_writeq(struct nfp_net_hw *hw,
  *   Value to add to the queue pointer
  */
 static inline void
-nfp_qcp_ptr_add(uint8_t *q,
+nfp_qcp_ptr_add(uint8_t *queue,
 		enum nfp_qcp_ptr ptr,
 		uint32_t val)
 {
@@ -322,19 +322,19 @@  nfp_qcp_ptr_add(uint8_t *q,
 	else
 		off = NFP_QCP_QUEUE_ADD_WPTR;
 
-	nn_writel(rte_cpu_to_le_32(val), q + off);
+	nn_writel(rte_cpu_to_le_32(val), queue + off);
 }
 
 /**
  * Read the current read/write pointer value for a queue.
  *
- * @param q
+ * @param queue
  *   Base address for queue structure
  * @param ptr
  *   Read or Write pointer
  */
 static inline uint32_t
-nfp_qcp_read(uint8_t *q,
+nfp_qcp_read(uint8_t *queue,
 		enum nfp_qcp_ptr ptr)
 {
 	uint32_t off;
@@ -345,12 +345,12 @@  nfp_qcp_read(uint8_t *q,
 	else
 		off = NFP_QCP_QUEUE_STS_HI;
 
-	val = rte_cpu_to_le_32(nn_readl(q + off));
+	val = rte_cpu_to_le_32(nn_readl(queue + off));
 
 	if (ptr == NFP_QCP_READ_PTR)
-		return val & NFP_QCP_QUEUE_STS_LO_READPTR_mask;
+		return val & NFP_QCP_QUEUE_STS_LO_READPTR_MASK;
 	else
-		return val & NFP_QCP_QUEUE_STS_HI_WRITEPTR_mask;
+		return val & NFP_QCP_QUEUE_STS_HI_WRITEPTR_MASK;
 }
 
 static inline uint32_t
diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c
index 7096695de6..7fb7b3efc5 100644
--- a/drivers/net/nfp/nfp_ethdev_vf.c
+++ b/drivers/net/nfp/nfp_ethdev_vf.c
@@ -396,7 +396,7 @@  nfp_vf_pci_uninit(struct rte_eth_dev *eth_dev)
 }
 
 static int
-eth_nfp_vf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+nfp_vf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		struct rte_pci_device *pci_dev)
 {
 	return rte_eth_dev_pci_generic_probe(pci_dev,
@@ -404,7 +404,7 @@  eth_nfp_vf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 }
 
 static int
-eth_nfp_vf_pci_remove(struct rte_pci_device *pci_dev)
+nfp_vf_pci_remove(struct rte_pci_device *pci_dev)
 {
 	return rte_eth_dev_pci_generic_remove(pci_dev, nfp_vf_pci_uninit);
 }
@@ -412,8 +412,8 @@  eth_nfp_vf_pci_remove(struct rte_pci_device *pci_dev)
 static struct rte_pci_driver rte_nfp_net_vf_pmd = {
 	.id_table = pci_id_nfp_vf_net_map,
 	.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-	.probe = eth_nfp_vf_pci_probe,
-	.remove = eth_nfp_vf_pci_remove,
+	.probe = nfp_vf_pci_probe,
+	.remove = nfp_vf_pci_remove,
 };
 
 RTE_PMD_REGISTER_PCI(net_nfp_vf, rte_nfp_net_vf_pmd);