[dpdk-test-report] |WARNING| pw47958 mem: accelerate dpdk program startup by reuse page from page cache

checkpatch at dpdk.org checkpatch at dpdk.org
Fri Nov 9 08:59:47 CET 2018


Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/47958

_coding style issues_


WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#15: 
During procless startup, dpdk invokes clear_hugedir() to unlink all hugepage files under /dev/hugepages.

WARNING:BRACES: braces {} are not necessary for single statement blocks
#115: FILE: lib/librte_eal/common/malloc_heap.c:174:
+	if (elem == NULL) {
+		return NULL;
+	}

ERROR:CODE_INDENT: code indent should use tabs where possible
#179: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:76:
+        if (reuse == 1) {$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#179: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:76:
+        if (reuse == 1) {$

WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 12)
#179: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:76:
+        if (reuse == 1) {
+            nr_hp_file = "nr_hugepages";

WARNING:BRACES: braces {} are not necessary for single statement blocks
#179: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:76:
+        if (reuse == 1) {
+            nr_hp_file = "nr_hugepages";
+        }

ERROR:CODE_INDENT: code indent should use tabs where possible
#180: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:77:
+            nr_hp_file = "nr_hugepages";$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#180: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:77:
+            nr_hp_file = "nr_hugepages";$

ERROR:CODE_INDENT: code indent should use tabs where possible
#181: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:78:
+        }$

WARNING:LEADING_SPACE: please, no spaces at the start of a line
#181: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:78:
+        }$

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#194: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:137:
+ * */

ERROR:SPACING: space prohibited before that close parenthesis ')'
#209: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:152:
+	if (mp == NULL || nr_pages <= 0 || pagesize == 0 ) {

ERROR:SPACING: space prohibited after that open parenthesis '('
#229: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:172:
+		if  ( strncmp(dirent->d_name, ".", 1 ) == 0

ERROR:SPACING: space prohibited before that close parenthesis ')'
#229: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:172:
+		if  ( strncmp(dirent->d_name, ".", 1 ) == 0

ERROR:SPACING: space prohibited before that close parenthesis ')'
#230: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:173:
+				||  strncmp(dirent->d_name, "..", 2 ) == 0 ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#236: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:179:
+				&& strncmp(dirent->d_name, ".", 1 ) != 0

ERROR:SPACING: space prohibited before that close parenthesis ')'
#237: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:180:
+				&& strncmp(dirent->d_name, "..", 2 ) != 0 ) {

ERROR:SPACING: space prohibited after that open parenthesis '('
#254: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:197:
+		if ( fstat( fd, &file_stat ) < 0 ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#254: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:197:
+		if ( fstat( fd, &file_stat ) < 0 ) {

ERROR:SPACING: space prohibited after that open parenthesis '('
#260: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:203:
+		if ( (uint64_t)file_stat.st_size != pagesize ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#260: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:203:
+		if ( (uint64_t)file_stat.st_size != pagesize ) {

WARNING:LONG_LINE: line over 90 characters
#267: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:210:
+		file_mmap = mmap((void *)0, pagesize, PROT_READ, MAP_SHARED|MAP_POPULATE, fd, 0);

ERROR:SPACING: space prohibited after that open parenthesis '('
#268: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:211:
+		if ( file_mmap == MAP_FAILED ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#268: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:211:
+		if ( file_mmap == MAP_FAILED ) {

ERROR:SPACING: space prohibited after that open parenthesis '('
#274: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:217:
+		if ( mincore(file_mmap, pagesize, mincore_vec) != 0 ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#274: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:217:
+		if ( mincore(file_mmap, pagesize, mincore_vec) != 0 ) {

ERROR:SPACING: space prohibited after that '!' (ctx:BxW)
#280: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:223:
+		if (! (mincore_vec[0] & 1) ){
 		    ^

ERROR:SPACING: space required before the open brace '{'
#280: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:223:
+		if (! (mincore_vec[0] & 1) ){

ERROR:SPACING: space prohibited before that close parenthesis ')'
#280: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:223:
+		if (! (mincore_vec[0] & 1) ){

ERROR:SPACING: space required after that close brace '}'
#290: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:233:
+	}/*for loop end*/

WARNING:TYPO_SPELLING: 'successfull' may be misspelled - perhaps 'successful'?
#297: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:240:
+	/*the successfull case*/

WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line
#316: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:259:
+ * */

WARNING:BRACES: braces {} are not necessary for single statement blocks
#331: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:274:
+	if (dir == NULL) {
+		return 0;
+	}

WARNING:TYPO_SPELLING: 'happend' may be misspelled - perhaps 'happened'?
#341: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:284:
+		/*shall not happend*/

WARNING:BRACES: braces {} are not necessary for single statement blocks
#342: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:285:
+		if (num_sizes >= MAX_HUGEPAGE_SIZES) {
+			return 0;
+		}

ERROR:SPACING: space prohibited after that open parenthesis '('
#350: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:293:
+			if ( 0 == cb_fn(hugedir, nr, hugepage_sz) ) {

ERROR:SPACING: space prohibited before that close parenthesis ')'
#350: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:293:
+			if ( 0 == cb_fn(hugedir, nr, hugepage_sz) ) {

WARNING:CONSTANT_COMPARISON: Comparisons should place the constant on the right side of the test
#350: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:293:
+			if ( 0 == cb_fn(hugedir, nr, hugepage_sz) ) {

WARNING:BRACES: braces {} are not necessary for single statement blocks
#350: FILE: lib/librte_eal/linuxapp/eal/eal_hugepage_info.c:293:
+			if ( 0 == cb_fn(hugedir, nr, hugepage_sz) ) {
+				return 0;
+			}

ERROR:MISSING_SIGN_OFF: Missing Signed-off-by: line(s)

total: 24 errors, 16 warnings, 329 lines checked


More information about the test-report mailing list