Commit 9b3517e
committed
selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes
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]>1 parent 63b4a32 commit 9b3517e
1 file changed
+32
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
| 210 | + | |
210 | 211 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
239 | | - | |
| 240 | + | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| |||
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
270 | 255 | | |
271 | 256 | | |
272 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| |||
0 commit comments