[dpdk-test-report] |WARNING| pw61491 [RFC v6 3/6] test/ring: add functional tests for configurable element size ring
checkpatch at dpdk.org
checkpatch at dpdk.org
Mon Oct 21 02:24:48 CEST 2019
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/61491
_coding style issues_
ERROR:MULTISTATEMENT_MACRO_USE_DO_WHILE: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects
#123: FILE: app/test/test_ring_elem.c:61:
+#define TEST_RING_VERIFY(exp) \
+ if (!(exp)) { \
+ printf("error at %s:%d condition " #exp " failed
", \
+ __func__, __LINE__); \
+ rte_ring_dump(stdout, r); \
+ return -1; \
+ }
WARNING:MACRO_WITH_FLOW_CONTROL: Macros with flow control statements should be avoided
#123: FILE: app/test/test_ring_elem.c:61:
+#define TEST_RING_VERIFY(exp) \
+ if (!(exp)) { \
+ printf("error at %s:%d condition " #exp " failed
", \
+ __func__, __LINE__); \
+ rte_ring_dump(stdout, r); \
+ return -1; \
+ }
WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#139: FILE: app/test/test_ring_elem.c:77:
+ unsigned i, rand;
WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#140: FILE: app/test/test_ring_elem.c:78:
+ const unsigned rsz = RING_SIZE - 1;
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#144: FILE: app/test/test_ring_elem.c:82:
+ for (i = 0; TEST_RING_FULL_EMTPY_ITER != i; i++) {
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#157: FILE: app/test/test_ring_elem.c:95:
+ TEST_RING_VERIFY(0 == rte_ring_free_count(r));
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#160: FILE: app/test/test_ring_elem.c:98:
+ TEST_RING_VERIFY(0 == rte_ring_empty(r));
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#166: FILE: app/test/test_ring_elem.c:104:
+ TEST_RING_VERIFY(0 == rte_ring_count(r));
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#167: FILE: app/test/test_ring_elem.c:105:
+ TEST_RING_VERIFY(0 == rte_ring_full(r));
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#171: FILE: app/test/test_ring_elem.c:109:
+ TEST_RING_VERIFY(0 == memcmp(src, dst, rsz));
WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#182: FILE: app/test/test_ring_elem.c:120:
+ unsigned i, num_elems;
WARNING:BRACES: braces {} are not necessary for single statement blocks
#189: FILE: app/test/test_ring_elem.c:127:
+ for (i = 0; i < RING_SIZE*2 ; i++) {
+ src[i] = (void *)(unsigned long)i;
+ }
ERROR:SPACING: spaces required around that '<' (ctx:VxV)
#295: FILE: app/test/test_ring_elem.c:233:
+ for (i = 0; i<RING_SIZE/MAX_BULK; i++) {
^
WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#385: FILE: app/test/test_ring_elem.c:323:
+ unsigned i;
WARNING:BRACES: braces {} are not necessary for single statement blocks
#392: FILE: app/test/test_ring_elem.c:330:
+ for (i = 0; i < RING_SIZE*2 ; i++) {
+ src[i] = (void *)(unsigned long)i;
+ }
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#405: FILE: app/test/test_ring_elem.c:343:
+ printf("Test SP & SC basic functions
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#453: FILE: app/test/test_ring_elem.c:391:
+ printf("Test enqueue without enough memory space
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#461: FILE: app/test/test_ring_elem.c:399:
+ printf("Enqueue 2 objects, free entries = MAX_BULK - 2
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#467: FILE: app/test/test_ring_elem.c:405:
+ printf("Enqueue the remaining entries = MAX_BULK - 2
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#474: FILE: app/test/test_ring_elem.c:412:
+ printf("Test if ring is full
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#478: FILE: app/test/test_ring_elem.c:416:
+ printf("Test enqueue for a full entry
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#483: FILE: app/test/test_ring_elem.c:421:
+ printf("Test dequeue without enough objects
");
ERROR:SPACING: spaces required around that '<' (ctx:VxV)
#484: FILE: app/test/test_ring_elem.c:422:
+ for (i = 0; i<RING_SIZE/MAX_BULK - 1; i++) {
^
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#502: FILE: app/test/test_ring_elem.c:440:
+ printf("Test if ring is empty
");
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#504: FILE: app/test/test_ring_elem.c:442:
+ if (1 != rte_ring_empty(r))
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#518: FILE: app/test/test_ring_elem.c:456:
+ printf("Test MP & MC basic functions
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#590: FILE: app/test/test_ring_elem.c:528:
+ printf("Test enqueue without enough memory space
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#610: FILE: app/test/test_ring_elem.c:548:
+ printf("Test dequeue without enough objects
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#640: FILE: app/test/test_ring_elem.c:578:
+ printf("Covering rte_ring_enqueue_burst functions
");
ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar"
#669: FILE: app/test/test_ring_elem.c:607:
+ struct rte_ring * rp = NULL;
WARNING:LONG_LINE: line over 90 characters
#672: FILE: app/test/test_ring_elem.c:610:
+ rp = rte_ring_create_elem("test_bad_ring_size", RING_SIZE + 1, 8, SOCKET_ID_ANY, 0);
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#673: FILE: app/test/test_ring_elem.c:611:
+ if (NULL != rp) {
WARNING:BRACES: braces {} are not necessary for single statement blocks
#673: FILE: app/test/test_ring_elem.c:611:
+ if (NULL != rp) {
+ return -1;
+ }
WARNING:LONG_LINE: line over 90 characters
#678: FILE: app/test/test_ring_elem.c:616:
+ rp = rte_ring_create_elem("test_bad_ring_size", (RTE_RING_SZ_MASK + 1), 8, SOCKET_ID_ANY, 0);
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#679: FILE: app/test/test_ring_elem.c:617:
+ if (NULL != rp) {
WARNING:BRACES: braces {} are not necessary for single statement blocks
#679: FILE: app/test/test_ring_elem.c:617:
+ if (NULL != rp) {
+ return -1;
+ }
ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar"
#691: FILE: app/test/test_ring_elem.c:629:
+ struct rte_ring * rp;
WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#694: FILE: app/test/test_ring_elem.c:632:
+ if (NULL != rp)
ERROR:SPACING: space prohibited before that close parenthesis ')'
#708: FILE: app/test/test_ring_elem.c:646:
+ 4097, 8, SOCKET_ID_ANY, 0 );
ERROR:SPACING: space required before the open brace '{'
#709: FILE: app/test/test_ring_elem.c:647:
+ if(r != NULL){
ERROR:SPACING: space required before the open parenthesis '('
#709: FILE: app/test/test_ring_elem.c:647:
+ if(r != NULL){
WARNING:BRACES: braces {} are not necessary for single statement blocks
#709: FILE: app/test/test_ring_elem.c:647:
+ if(r != NULL){
+ return -1;
+ }
WARNING:UNSPECIFIED_INT: Prefer 'unsigned int' to bare use of 'unsigned'
#722: FILE: app/test/test_ring_elem.c:660:
+ unsigned i;
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#728: FILE: app/test/test_ring_elem.c:666:
+ printf("test_ring_basic_ex fail to rte_malloc
");
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#735: FILE: app/test/test_ring_elem.c:673:
+ printf("test_ring_basic_ex fail to create ring
");
WARNING:BRACES: braces {} are not necessary for single statement blocks
#739: FILE: app/test/test_ring_elem.c:677:
+ if (rte_ring_lookup("test_ring_basic_ex") != rp) {
+ goto fail_test;
+ }
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#744: FILE: app/test/test_ring_elem.c:682:
+ printf("test_ring_basic_ex ring is not empty but it should be
");
ERROR:SPACING: space prohibited before that '++' (ctx:WxB)
#750: FILE: app/test/test_ring_elem.c:688:
+ for (i = 0; i < RING_SIZE; i ++) {
^
WARNING:BRACES: braces {} are not necessary for single statement blocks
#750: FILE: app/test/test_ring_elem.c:688:
+ for (i = 0; i < RING_SIZE; i ++) {
+ rte_ring_enqueue_elem(rp, &obj[i], 8);
+ }
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#755: FILE: app/test/test_ring_elem.c:693:
+ printf("test_ring_basic_ex ring is not full but it should be
");
ERROR:SPACING: space prohibited before that '++' (ctx:WxB)
#759: FILE: app/test/test_ring_elem.c:697:
+ for (i = 0; i < RING_SIZE; i ++) {
^
WARNING:BRACES: braces {} are not necessary for single statement blocks
#759: FILE: app/test/test_ring_elem.c:697:
+ for (i = 0; i < RING_SIZE; i ++) {
+ rte_ring_dequeue_elem(rp, &obj[i], 8);
+ }
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#764: FILE: app/test/test_ring_elem.c:702:
+ printf("test_ring_basic_ex ring is not empty but it should be
");
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#771: FILE: app/test/test_ring_elem.c:709:
+ printf("test_ring_basic_ex: rte_ring_enqueue_burst fails
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#771: FILE: app/test/test_ring_elem.c:709:
+ printf("test_ring_basic_ex: rte_ring_enqueue_burst fails
");
WARNING:EMBEDDED_FUNCTION_NAME: Prefer using '"%s...", __func__' to using 'test_ring_basic_ex', this function's name, in a string
#777: FILE: app/test/test_ring_elem.c:715:
+ printf("test_ring_basic_ex: rte_ring_dequeue_burst fails
");
WARNING:QUOTED_WHITESPACE_BEFORE_NEWLINE: unnecessary whitespace before a quoted newline
#777: FILE: app/test/test_ring_elem.c:715:
+ printf("test_ring_basic_ex: rte_ring_dequeue_burst fails
");
ERROR:SPACING: space required before the open brace '{'
#891: FILE: app/test/test_ring_elem.c:829:
+ if ( test_create_count_odd() < 0){
ERROR:SPACING: space prohibited after that open parenthesis '('
#891: FILE: app/test/test_ring_elem.c:829:
+ if ( test_create_count_odd() < 0){
total: 12 errors, 47 warnings, 873 lines checked
More information about the test-report
mailing list