DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yasin CANER <yasinncaner@gmail.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, stephen@networkplumber.org
Subject: [PATCH v2] lib/kni : coding style is fixed
Date: Tue, 16 May 2023 11:03:59 +0000	[thread overview]
Message-ID: <20230516110359.479441-1-yasinncaner@gmail.com> (raw)
In-Reply-To: <20230516104853.479297-1-yasinncaner@gmail.com>

Coverity issue:
Bugzilla ID: 1227
Fixes:
Cc: stable@dpdk.org
Cc: stephen@networkplumber.org

Coding style is fixed
---
 lib/kni/rte_kni.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c
index 2244892aae..703333c2da 100644
--- a/lib/kni/rte_kni.c
+++ b/lib/kni/rte_kni.c
@@ -683,20 +683,21 @@ kni_allocate_mbufs(struct rte_kni *kni)
 		RTE_LOG(ERR, KNI, "No valid mempool for allocating mbufs\n");
 		return;
 	}
-	/* First, getting allocation count from alloc_q. alloc_q is allocated in this function 
-	 * and/or kni_alloc function from mempool.
-	 * If alloc_q is completely removed, it shall be allocated again.
-	 * */
+
+	/* First, getting allocation count from alloc_q. alloc_q is allocated in this function*/ 
+	/* and/or kni_alloc function from mempool.*/
+	/* If alloc_q is completely removed, it shall be allocated again.*/
+
 	allocq = kni_fifo_count(kni->alloc_q);
 	/* How many free allocation is possible from mempool. */
 	allocq_free = kni_fifo_free_count(kni->alloc_q);
 	/* Allocated alloc_q count shall be max MAX_MBUF_BURST_NUM. */
 	allocq_count = MAX_MBUF_BURST_NUM - (int)allocq;
 	/* Try to figure out how many allocation is possible. allocq_free is max possible.*/
-	allocq_free = (allocq_free > MAX_MBUF_BURST_NUM )? MAX_MBUF_BURST_NUM : allocq_free;
+	allocq_free = (allocq_free > MAX_MBUF_BURST_NUM) ? MAX_MBUF_BURST_NUM : allocq_free;
 	/* Buffer is not removed so no need re-allocate*/
 
-	if(!allocq_count) {
+	if (!allocq_count) {
 		/* Buffer is not removed so no need re-allocation*/
 		return;
 	} else if (allocq_free > allocq_count) {
-- 
2.25.1


  reply	other threads:[~2023-05-16 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 10:48 [PATCH] lib/kni : fix memory-leak on rte_kni_rx_burst Yasin CANER
2023-05-16 11:03 ` Yasin CANER [this message]
2023-05-16 15:16   ` [PATCH v2] lib/kni : coding style is fixed Stephen Hemminger
2023-05-17 18:25 ` [PATCH] lib/kni : fix memory-leak on rte_kni_rx_burst 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=20230516110359.479441-1-yasinncaner@gmail.com \
    --to=yasinncaner@gmail.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    /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).