From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58402423F4; Tue, 17 Jan 2023 01:15:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73B0042D1E; Tue, 17 Jan 2023 01:14:59 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 8561440042 for ; Tue, 17 Jan 2023 01:14:57 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id o7-20020a17090a0a0700b00226c9b82c3aso32509513pjo.3 for ; Mon, 16 Jan 2023 16:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jt06Tue8zlbGHY7MyvXJ3NU5WIRbNhYm/MZKyJAngIA=; b=u5ZaWsJJjPTVoJjgJlt0D15zVYjXPurKT9J6NjTrnkepOFqtE09TXNylsvwX3a1rPg daL8LRYFMB8CQv7JVoqw0Ep+shwCbNkftmEVdJWlE368dynCWO5ZLzr1s+OQQuvvW4c6 i2RG20DYDmVjEt8Nkj4i7r8NO+7ic1s6WDN+FG8BY2MzJxf9nYK99JKkSRwopBg8tISJ jeitmYHm1E05+yGKg52rCdekM+Brm0AaDQM87Q+X+XiQtz0HphQiHqNobJQDv4Mrir5t ASFV4wXG866K6TTZByUwfAR8gdmbETy6c8rMSbwuSREGcRF8sw/aURQmAYnpin47tv6x 0Stw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jt06Tue8zlbGHY7MyvXJ3NU5WIRbNhYm/MZKyJAngIA=; b=mKhm+wlXA8CnZz3ZliVBZ5mzM8Nzz+fGOVpI6KtkBjQxoE/vbVDo3RIj/MAiY/gV2r 3lIW3kMYpmFbTwfSjMOfOGFHbz2ZuEg3PGWsxYOSxYOTdcppsSacP5P320bIMi/yp9iP fu1ZC2hTLoa3Hwkm6zDx14zA9RJSyI+Gnq6TUW8byPRUljCs85K/eU33Vp4LViCd0bPg 7w/Fc7h0KaciIo9qNMPh95bSV0MBahWUWswppJR8nT4exqZkeS4njmvFbyZGjUbAaR1z yW8lYK/o/su4Y9QWUqEQ+wKx77tdnx2jDYOmoecDEfxkujjHdZ/lSjfAQbSHOblJ0+60 uj6g== X-Gm-Message-State: AFqh2krGhmUaul3hetc4tu+SgFyMmb5+WbFQWv2/X1H5cXby9is+wnU1 vHLUi2N457YxD7Rscl/qQn3FwOdO9hjB7KgYugo= X-Google-Smtp-Source: AMrXdXv/7OgCnaNR9YQbZxETAB4U71PShYu5c1S8wC/t4rGsbCpZZn+hIJEtjb2ReqmC7BrcigyX0Q== X-Received: by 2002:a05:6a20:a5a2:b0:b8:8a94:5bf with SMTP id bc34-20020a056a20a5a200b000b88a9405bfmr896564pzb.21.1673914496345; Mon, 16 Jan 2023 16:14:56 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id z24-20020a630a58000000b004790eb3fee1sm15940614pgk.90.2023.01.16.16.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 16:14:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , Anatoly Burakov , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v3 1/7] test: fix whitespace Date: Mon, 16 Jan 2023 16:14:47 -0800 Message-Id: <20230117001453.94082-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230117001453.94082-1-stephen@networkplumber.org> References: <20230116172732.84976-1-stephen@networkplumber.org> <20230117001453.94082-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The style standard is to use blank after keywords. I.e "if (" not "if(" Signed-off-by: Stephen Hemminger --- app/test/test_cmdline_cirbuf.c | 4 ++-- app/test/test_debug.c | 6 +++--- app/test/test_hash.c | 10 +++++----- app/test/test_lpm6_perf.c | 2 +- app/test/test_malloc.c | 14 +++++++------- app/test/test_mbuf.c | 15 +++++++-------- app/test/test_ring_perf.c | 2 +- app/test/test_spinlock.c | 2 +- 8 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/test/test_cmdline_cirbuf.c b/app/test/test_cmdline_cirbuf.c index 8ac326cb02e0..6f7aae6df59a 100644 --- a/app/test/test_cmdline_cirbuf.c +++ b/app/test/test_cmdline_cirbuf.c @@ -708,7 +708,7 @@ test_cirbuf_char_fill(void) return -1; } /* delete buffer from tail */ - for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++) + for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++) cirbuf_del_tail_safe(&cb); /* try to delete from an empty buffer */ if (cirbuf_del_tail_safe(&cb) >= 0) { @@ -737,7 +737,7 @@ test_cirbuf_char_fill(void) return -1; } /* delete buffer from head */ - for(i = 0; i < CMDLINE_TEST_BUFSIZE; i++) + for (i = 0; i < CMDLINE_TEST_BUFSIZE; i++) cirbuf_del_head_safe(&cb); /* try to delete from an empty buffer */ if (cirbuf_del_head_safe(&cb) >= 0) { diff --git a/app/test/test_debug.c b/app/test/test_debug.c index 2704f5b92726..24f14bd11313 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -53,7 +53,7 @@ test_panic(void) return -1; } wait(&status); - if(status == 0){ + if (status == 0) { printf("Child process terminated normally!\n"); return -1; } else @@ -78,13 +78,13 @@ test_exit_val(int exit_val) if (pid == 0) rte_exit(exit_val, __func__); - else if (pid < 0){ + else if (pid < 0) { printf("Fork Failed\n"); return -1; } wait(&status); printf("Child process status: %d\n", status); - if(!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val){ + if (!WIFEXITED(status) || WEXITSTATUS(status) != (uint8_t)exit_val) { printf("Child process terminated with incorrect status (expected = %d)!\n", exit_val); return -1; diff --git a/app/test/test_hash.c b/app/test/test_hash.c index 3e45afaa67fc..b1307ce42e6b 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -50,7 +50,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21, if (handle) rte_hash_free(handle); \ return -1; \ } \ -} while(0) +} while (0) #define RETURN_IF_ERROR_FBK(cond, str, ...) do { \ if (cond) { \ @@ -58,7 +58,7 @@ static uint32_t hashtest_key_lens[] = {0, 2, 4, 5, 6, 7, 8, 10, 11, 15, 16, 21, if (handle) rte_fbk_hash_free(handle); \ return -1; \ } \ -} while(0) +} while (0) #define RETURN_IF_ERROR_RCU_QSBR(cond, str, ...) do { \ if (cond) { \ @@ -724,12 +724,12 @@ static int test_five_keys(void) } /* Lookup */ - for(i = 0; i < 5; i++) + for (i = 0; i < 5; i++) key_array[i] = &keys[i]; ret = rte_hash_lookup_bulk(handle, &key_array[0], 5, (int32_t *)pos); - if(ret == 0) - for(i = 0; i < 5; i++) { + if (ret == 0) + for (i = 0; i < 5; i++) { print_key_info("Lkp", key_array[i], pos[i]); RETURN_IF_ERROR(pos[i] != expected_pos[i], "failed to find key (pos[%u]=%d)", i, pos[i]); diff --git a/app/test/test_lpm6_perf.c b/app/test/test_lpm6_perf.c index aaf2773b6fac..2f9321345e4b 100644 --- a/app/test/test_lpm6_perf.c +++ b/app/test/test_lpm6_perf.c @@ -47,7 +47,7 @@ print_route_distribution(const struct rules_tbl_entry *table, uint32_t n) printf("--------------------------- \n"); /* Count depths. */ - for(i = 1; i <= 128; i++) { + for (i = 1; i <= 128; i++) { unsigned depth_counter = 0; double percent_hits; diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index de40e506113a..8d3750a3f1f0 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -86,8 +86,8 @@ test_align_overlap_per_lcore(__rte_unused void *arg) ret = -1; break; } - for(j = 0; j < 1000 ; j++) { - if( *(char *)p1 != 0) { + for (j = 0; j < 1000 ; j++) { + if (*(char *)p1 != 0) { printf("rte_zmalloc didn't zero the allocated memory\n"); ret = -1; } @@ -157,8 +157,8 @@ test_reordered_free_per_lcore(__rte_unused void *arg) ret = -1; break; } - for(j = 0; j < 1000 ; j++) { - if( *(char *)p1 != 0) { + for (j = 0; j < 1000 ; j++) { + if (*(char *)p1 != 0) { printf("rte_zmalloc didn't zero the allocated memory\n"); ret = -1; } @@ -331,12 +331,12 @@ test_multi_alloc_statistics(void) /* After freeing both allocations check stats return to original */ rte_malloc_get_socket_stats(socket, &post_stats); - if(second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) { + if (second_stats.heap_totalsz_bytes != first_stats.heap_totalsz_bytes) { printf("Incorrect heap statistics: Total size \n"); return -1; } /* Check allocated size is equal to two additions plus overhead */ - if(second_stats.heap_allocsz_bytes != + if (second_stats.heap_allocsz_bytes != size + overhead + first_stats.heap_allocsz_bytes) { printf("Incorrect heap statistics: Allocated size \n"); return -1; @@ -495,7 +495,7 @@ test_realloc_socket(int socket) return -1; } /* calc an alignment we don't already have */ - while(RTE_PTR_ALIGN(ptr7, new_align) == ptr7) + while (RTE_PTR_ALIGN(ptr7, new_align) == ptr7) new_align *= 2; char *ptr8 = rte_realloc_socket(ptr7, size7, new_align, socket); if (!ptr8){ diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 53fe898a384c..0b45749e9b03 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -120,7 +120,7 @@ static unsigned refcnt_lcore[RTE_MAX_LCORE]; printf("mbuf test FAILED (l.%d): <" str ">\n", \ __LINE__, ##__VA_ARGS__); \ goto fail; \ -} while(0) +} while (0) /* * test data manipulation in mbuf with non-ascii data @@ -154,9 +154,8 @@ test_pktmbuf_with_non_ascii_data(struct rte_mempool *pktmbuf_pool) return 0; fail: - if(m) { - rte_pktmbuf_free(m); - } + rte_pktmbuf_free(m); + return -1; } @@ -701,12 +700,12 @@ test_pktmbuf_pool(struct rte_mempool *pktmbuf_pool) } struct rte_mbuf *extra = NULL; extra = rte_pktmbuf_alloc(pktmbuf_pool); - if(extra != NULL) { + if (extra != NULL) { printf("Error pool not empty"); ret = -1; } extra = rte_pktmbuf_clone(m[0], pktmbuf_pool); - if(extra != NULL) { + if (extra != NULL) { printf("Error pool not empty"); ret = -1; } @@ -966,7 +965,7 @@ test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool) struct rte_mbuf *mb, *mt; mb = m[i]; - while(mb != NULL) { + while (mb != NULL) { mt = mb; mb = mb->next; rte_pktmbuf_free_seg(mt); @@ -1195,7 +1194,7 @@ verify_mbuf_check_panics(struct rte_mbuf *buf) return -1; } wait(&status); - if(status == 0) + if (status == 0) return -1; return 0; diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 2d8bb675a331..4cac9a94a73c 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -190,7 +190,7 @@ enqueue_dequeue_bulk_helper(const unsigned int flag, const int esize, #else if (__sync_add_and_fetch(&lcore_count, 1) != 2) #endif - while(lcore_count != 2) + while (lcore_count != 2) rte_pause(); burst = test_ring_calloc(MAX_BURST, esize); diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c index 3f59372300c3..3ee82fa963a5 100644 --- a/app/test/test_spinlock.c +++ b/app/test/test_spinlock.c @@ -237,7 +237,7 @@ test_spinlock(void) /* * Try to acquire a lock that we already own */ - if(!rte_spinlock_recursive_trylock(&slr)) { + if (!rte_spinlock_recursive_trylock(&slr)) { printf("rte_spinlock_recursive_trylock failed on a lock that " "we already own\n"); ret = -1; -- 2.39.0