DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <sthemmin@microsoft.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v4 8/8] kni: fix style issues
Date: Wed, 19 Jun 2019 11:59:58 -0700	[thread overview]
Message-ID: <20190619185958.27306-9-stephen@networkplumber.org> (raw)
In-Reply-To: <20190619185958.27306-1-stephen@networkplumber.org>

From: Stephen Hemminger <sthemmin@microsoft.com>

rte_kni does not follow standard style rules.
Noticed some extra \ line continuation etc.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_kni/rte_kni.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index e29d0cc7df3c..9b6acc382fc3 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -59,7 +59,7 @@ struct rte_kni {
 	uint16_t group_id;                  /**< Group ID of KNI devices */
 	uint32_t slot_id;                   /**< KNI pool slot ID */
 	struct rte_mempool *pktmbuf_pool;   /**< pkt mbuf mempool */
-	unsigned mbuf_size;                 /**< mbuf size */
+	unsigned int mbuf_size;                 /**< mbuf size */
 
 	const struct rte_memzone *m_tx_q;   /**< TX queue memzone */
 	const struct rte_memzone *m_rx_q;   /**< RX queue memzone */
@@ -78,7 +78,7 @@ struct rte_kni {
 	/* For request & response */
 	struct rte_kni_fifo *req_q;         /**< Request queue */
 	struct rte_kni_fifo *resp_q;        /**< Response queue */
-	void * sync_addr;                   /**< Req/Resp Mem address */
+	void *sync_addr;                   /**< Req/Resp Mem address */
 
 	struct rte_kni_ops ops;             /**< operations for request */
 };
@@ -473,7 +473,7 @@ kni_config_promiscusity(uint16_t port_id, uint8_t to_on)
 int
 rte_kni_handle_request(struct rte_kni *kni)
 {
-	unsigned ret;
+	unsigned int ret;
 	struct rte_kni_request *req = NULL;
 
 	if (kni == NULL)
@@ -498,8 +498,8 @@ rte_kni_handle_request(struct rte_kni *kni)
 		break;
 	case RTE_KNI_REQ_CFG_NETWORK_IF: /* Set network interface up/down */
 		if (kni->ops.config_network_if)
-			req->result = kni->ops.config_network_if(\
-					kni->ops.port_id, req->if_up);
+			req->result = kni->ops.config_network_if(kni->ops.port_id,
+								 req->if_up);
 		break;
 	case RTE_KNI_REQ_CHANGE_MAC_ADDR: /* Change MAC Address */
 		if (kni->ops.config_mac_address)
@@ -534,7 +534,7 @@ rte_kni_handle_request(struct rte_kni *kni)
 }
 
 unsigned
-rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num)
+rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)
 {
 	void *phy_mbufs[num];
 	unsigned int ret;
@@ -552,9 +552,9 @@ rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num)
 }
 
 unsigned
-rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned num)
+rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs, unsigned int num)
 {
-	unsigned ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);
+	unsigned int ret = kni_fifo_get(kni->tx_q, (void **)mbufs, num);
 
 	/* If buffers removed, allocate mbufs and then put them into alloc_q */
 	if (ret)
@@ -605,7 +605,7 @@ kni_allocate_mbufs(struct rte_kni *kni)
 		return;
 	}
 
-	allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1) \
+	allocq_free = (kni->alloc_q->read - kni->alloc_q->write - 1)
 			& (MAX_MBUF_BURST_NUM - 1);
 	for (i = 0; i < allocq_free; i++) {
 		pkts[i] = rte_pktmbuf_alloc(kni->pktmbuf_pool);
@@ -659,35 +659,35 @@ static enum kni_ops_status
 kni_check_request_register(struct rte_kni_ops *ops)
 {
 	/* check if KNI request ops has been registered*/
-	if( NULL == ops )
+	if (ops == NULL)
 		return KNI_REQ_NO_REGISTER;
 
-	if ((ops->change_mtu == NULL)
-		&& (ops->config_network_if == NULL)
-		&& (ops->config_mac_address == NULL)
-		&& (ops->config_promiscusity == NULL))
+	if (ops->change_mtu == NULL
+	    && ops->config_network_if == NULL
+	    && ops->config_mac_address == NULL
+	    && ops->config_promiscusity == NULL)
 		return KNI_REQ_NO_REGISTER;
 
 	return KNI_REQ_REGISTERED;
 }
 
 int
-rte_kni_register_handlers(struct rte_kni *kni,struct rte_kni_ops *ops)
+rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops)
 {
 	enum kni_ops_status req_status;
 
-	if (NULL == ops) {
+	if (ops == NULL) {
 		RTE_LOG(ERR, KNI, "Invalid KNI request operation.\n");
 		return -1;
 	}
 
-	if (NULL == kni) {
+	if (kni == NULL) {
 		RTE_LOG(ERR, KNI, "Invalid kni info.\n");
 		return -1;
 	}
 
 	req_status = kni_check_request_register(&kni->ops);
-	if ( KNI_REQ_REGISTERED == req_status) {
+	if (req_status == KNI_REQ_REGISTERED) {
 		RTE_LOG(ERR, KNI, "The KNI request operation has already registered.\n");
 		return -1;
 	}
@@ -699,7 +699,7 @@ rte_kni_register_handlers(struct rte_kni *kni,struct rte_kni_ops *ops)
 int
 rte_kni_unregister_handlers(struct rte_kni *kni)
 {
-	if (NULL == kni) {
+	if (kni == NULL) {
 		RTE_LOG(ERR, KNI, "Invalid kni info.\n");
 		return -1;
 	}
-- 
2.20.1


  parent reply	other threads:[~2019-06-19 19:01 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 17:51 [dpdk-dev] [PATCH v2 0/7] kni: cleanups and improvements Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 1/7] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 2/7] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 3/7] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 4/7] kni: drop unused fields Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 5/7] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 6/7] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-10 17:51 ` [dpdk-dev] [PATCH v2 7/7] doc: update KNI documentation Stephen Hemminger
2019-06-11 20:54 ` [dpdk-dev] [PATCH v2 0/7] kni: cleanups and improvements Stephen Hemminger
2019-06-11 21:18   ` Lance Richardson
2019-06-11 21:30     ` Stephen Hemminger
2019-06-11 21:49       ` Lance Richardson
2019-06-18 16:16 ` [dpdk-dev] [PATCH v3 0/8] kni: fixes and cleanups Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 1/8] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 2/8] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 3/8] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 4/8] kni: drop unused fields Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 5/8] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 6/8] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 7/8] doc: update KNI documentation Stephen Hemminger
2019-06-18 16:16   ` [dpdk-dev] [PATCH v3 8/8] kni: fix style issues Stephen Hemminger
2019-06-19 18:57 ` [dpdk-dev] [PATCH v3 0/8] kni: cleanups and fixes Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 1/8] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 2/8] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 3/8] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 4/8] kni: drop unused fields Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 5/8] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 6/8] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 7/8] doc: update KNI documentation Stephen Hemminger
2019-06-19 18:57   ` [dpdk-dev] [PATCH v3 8/8] kni: fix style issues Stephen Hemminger
2019-06-19 18:59 ` [dpdk-dev] [PATCH v4 0/8] kni: fixes and cleanups Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 1/8] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 2/8] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 3/8] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 4/8] kni: drop unused fields Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 5/8] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 6/8] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-19 18:59   ` [dpdk-dev] [PATCH v4 7/8] doc: update KNI documentation Stephen Hemminger
2019-06-19 18:59   ` Stephen Hemminger [this message]
2019-06-20 19:20 ` [dpdk-dev] [PATCH v5 0/9] kni: fixes and cleanups Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 1/9] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 2/9] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 3/9] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 4/9] kni: drop unused fields Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 5/9] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 6/9] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 7/9] doc: update KNI documentation Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 8/9] kni: fix style issues Stephen Hemminger
2019-06-20 19:20   ` [dpdk-dev] [PATCH v5 9/9] kni: add minimal ethtool Stephen Hemminger
2019-06-21  8:26     ` Igor Ryzhov
2019-06-21 15:10       ` Stephen Hemminger
2019-06-24 16:47 ` [dpdk-dev] [PATCH v6 0/9] kni: fixes and cleanups Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 1/9] kni: don't need stubs for rx_mode or ioctl Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 2/9] kni: use netdev_alloc_skb Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 3/9] kni: don't keep stats in kni_net Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 4/9] kni: drop unused fields Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 5/9] kni: use proper type for kni fifo's Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 6/9] kni: return -EFAULT if copy_from_user fails Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 7/9] kni: fix style issues Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 8/9] kni: add minimal ethtool Stephen Hemminger
2019-06-24 16:47   ` [dpdk-dev] [PATCH v6 9/9] doc: update KNI documentation Stephen Hemminger
2019-07-12 17:03   ` [dpdk-dev] [PATCH v6 0/9] kni: fixes and cleanups Ferruh Yigit
2019-07-15 17:18     ` Thomas Monjalon

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=20190619185958.27306-9-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sthemmin@microsoft.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).