DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	Long Wu <long.wu@corigine.com>,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH v3 09/11] net/nfp: rename some parameter and variable
Date: Fri, 13 Oct 2023 14:06:51 +0800	[thread overview]
Message-ID: <20231013060653.1006410-10-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231013060653.1006410-1-chaoyong.he@corigine.com>

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(-)

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);
-- 
2.39.1


  parent reply	other threads:[~2023-10-13  6:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-07  2:33 [PATCH 00/11] Unify the PMD coding style Chaoyong He
2023-10-07  2:33 ` [PATCH 01/11] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-10-07  2:33 ` [PATCH 02/11] net/nfp: unify the indent coding style Chaoyong He
2023-10-07  2:33 ` [PATCH 03/11] net/nfp: unify the type of integer variable Chaoyong He
2023-10-07  2:33 ` [PATCH 04/11] net/nfp: standard the local variable coding style Chaoyong He
2023-10-07  2:33 ` [PATCH 05/11] net/nfp: adjust the log statement Chaoyong He
2023-10-07  2:33 ` [PATCH 06/11] net/nfp: standard the comment style Chaoyong He
2023-10-07  2:33 ` [PATCH 07/11] net/nfp: standard the blank character Chaoyong He
2023-10-07  2:33 ` [PATCH 08/11] net/nfp: unify the guide line of header file Chaoyong He
2023-10-07  2:33 ` [PATCH 09/11] net/nfp: rename some parameter and variable Chaoyong He
2023-10-07  2:33 ` [PATCH 10/11] net/nfp: adjust logic to make it more readable Chaoyong He
2023-10-07  2:33 ` [PATCH 11/11] net/nfp: refact the meson build file Chaoyong He
2023-10-12  1:26 ` [PATCH v2 00/11] Unify the PMD coding style Chaoyong He
2023-10-12  1:26   ` [PATCH v2 01/11] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-10-12  1:26   ` [PATCH v2 02/11] net/nfp: unify the indent coding style Chaoyong He
2023-10-12  1:26   ` [PATCH v2 03/11] net/nfp: unify the type of integer variable Chaoyong He
2023-10-12  1:26   ` [PATCH v2 04/11] net/nfp: standard the local variable coding style Chaoyong He
2023-10-12  1:26   ` [PATCH v2 05/11] net/nfp: adjust the log statement Chaoyong He
2023-10-12  1:38     ` Stephen Hemminger
2023-10-12  1:40       ` Chaoyong He
2023-10-12  1:26   ` [PATCH v2 06/11] net/nfp: standard the comment style Chaoyong He
2023-10-12  1:27   ` [PATCH v2 07/11] net/nfp: standard the blank character Chaoyong He
2023-10-12  1:27   ` [PATCH v2 08/11] net/nfp: unify the guide line of header file Chaoyong He
2023-10-12  1:27   ` [PATCH v2 09/11] net/nfp: rename some parameter and variable Chaoyong He
2023-10-12  1:27   ` [PATCH v2 10/11] net/nfp: adjust logic to make it more readable Chaoyong He
2023-10-12  1:27   ` [PATCH v2 11/11] net/nfp: refact the meson build file Chaoyong He
2023-10-13  6:06   ` [PATCH v3 00/11] Unify the PMD coding style Chaoyong He
2023-10-13  6:06     ` [PATCH v3 01/11] net/nfp: explicitly compare to null and 0 Chaoyong He
2023-10-13  6:06     ` [PATCH v3 02/11] net/nfp: unify the indent coding style Chaoyong He
2023-10-13  6:06     ` [PATCH v3 03/11] net/nfp: unify the type of integer variable Chaoyong He
2023-10-13  6:06     ` [PATCH v3 04/11] net/nfp: standard the local variable coding style Chaoyong He
2023-10-13  6:06     ` [PATCH v3 05/11] net/nfp: adjust the log statement Chaoyong He
2023-10-13  6:06     ` [PATCH v3 06/11] net/nfp: standard the comment style Chaoyong He
2023-10-13  6:06     ` [PATCH v3 07/11] net/nfp: standard the blank character Chaoyong He
2023-10-13  6:06     ` [PATCH v3 08/11] net/nfp: unify the guide line of header file Chaoyong He
2023-10-13  6:06     ` Chaoyong He [this message]
2023-10-13  6:06     ` [PATCH v3 10/11] net/nfp: adjust logic to make it more readable Chaoyong He
2023-10-13  6:06     ` [PATCH v3 11/11] net/nfp: refact the meson build file Chaoyong He
2023-10-16 16:50       ` Ferruh Yigit
2023-10-16 16:50     ` [PATCH v3 00/11] Unify the PMD coding style Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231013060653.1006410-10-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).