You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR: "foo* bar" should be "foo *bar"
torvalds#41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209:
+const char* file_type_str(enum file_type type) {
ERROR: open brace '{' following function definitions go on the next line
torvalds#41: FILE: tools/testing/selftests/cachestat/test_cachestat.c:209:
+const char* file_type_str(enum file_type type) {
ERROR: switch and case should be at the same indent
torvalds#42: FILE: tools/testing/selftests/cachestat/test_cachestat.c:210:
+ switch (type) {
+ case FILE_SHMEM:
[...]
+ case FILE_MMAP:
[...]
+ default:
ERROR: space required after that ',' (ctx:VxV)
torvalds#72: FILE: tools/testing/selftests/cachestat/test_cachestat.c:239:
+ ksft_print_msg("Unable to create %s file.\n",file_type_str(type));
^
ERROR: space required after that ',' (ctx:VxV)
torvalds#79: FILE: tools/testing/selftests/cachestat/test_cachestat.c:245:
+ ksft_print_msg("Unable to truncate %s file.\n",file_type_str(type));
^
ERROR: switch and case should be at the same indent
torvalds#88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249:
+ switch (type){
+ case FILE_SHMEM:
[...]
+ case FILE_MMAP:
[...]
+ default:
ERROR: space required before the open brace '{'
torvalds#88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249:
+ switch (type){
WARNING: Missing a blank line after declarations
torvalds#98: FILE: tools/testing/selftests/cachestat/test_cachestat.c:259:
+ char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (map == MAP_FAILED) {
WARNING: braces {} are not necessary for single statement blocks
torvalds#103: FILE: tools/testing/selftests/cachestat/test_cachestat.c:264:
+ for (int i = 0; i < filesize; i++) {
+ map[i] = 'A';
+ }
WARNING: break is not useful after a goto
torvalds#111: FILE: tools/testing/selftests/cachestat/test_cachestat.c:272:
+ goto close_fd;
+ break;
total: 7 errors, 3 warnings, 108 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
./patches/selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
Please run checkpatch prior to sending patches
Cc: Johannes Weiner <[email protected]>
Cc: Joshua Hahn <[email protected]>
Cc: Nhat Pham <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Suresh K C <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
0 commit comments