[v2] lib/kni : coding style is fixed

Message ID 20230516110359.479441-1-yasinncaner@gmail.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] lib/kni : coding style is fixed |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation warning apply patch failure
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Yasin CANER May 16, 2023, 11:03 a.m. UTC
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(-)
  

Comments

Stephen Hemminger May 16, 2023, 3:16 p.m. UTC | #1
On Tue, 16 May 2023 11:03:59 +0000
Yasin CANER <yasinncaner@gmail.com> wrote:

> +	/* 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.*/

If you send another version of this patch. It would be good to follow the style of multi-line comment.
	/* 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.
	 */
  

Patch

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