* [folded-merged] selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes.patch removed from -mm tree
@ 2025-08-02 18:37 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-08-02 18:37 UTC (permalink / raw)
To: mm-commits, suresh.k.chandrappa, shuah, nphamcs, joshua.hahnjy,
hannes, akpm, akpm
The quilt patch titled
Subject: selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes
has been removed from the -mm tree. Its filename was
selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes.patch
This patch was dropped because it was folded into selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes
Date: Tue Jul 22 03:21:42 PM PDT 2025
ERROR: "foo* bar" should be "foo *bar"
#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
#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
#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)
#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)
#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
#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 '{'
#88: FILE: tools/testing/selftests/cachestat/test_cachestat.c:249:
+ switch (type){
WARNING: Missing a blank line after declarations
#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
#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
#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 <hannes@cmpxchg.org>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suresh K C <suresh.k.chandrappa@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/cachestat/test_cachestat.c | 62 +++++------
1 file changed, 32 insertions(+), 30 deletions(-)
--- a/tools/testing/selftests/cachestat/test_cachestat.c~selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes
+++ a/tools/testing/selftests/cachestat/test_cachestat.c
@@ -206,14 +206,15 @@ out1:
out:
return ret;
}
-const char* file_type_str(enum file_type type) {
+const char *file_type_str(enum file_type type)
+{
switch (type) {
- case FILE_SHMEM:
- return "shmem";
- case FILE_MMAP:
- return "mmap";
- default:
- return "unknown";
+ case FILE_SHMEM:
+ return "shmem";
+ case FILE_MMAP:
+ return "mmap";
+ default:
+ return "unknown";
}
}
@@ -236,7 +237,8 @@ bool run_cachestat_test(enum file_type t
fd = open(filename, O_RDWR | O_CREAT | O_TRUNC, 0666);
if (fd < 0) {
- ksft_print_msg("Unable to create %s file.\n",file_type_str(type));
+ ksft_print_msg("Unable to create %s file.\n",
+ file_type_str(type));
ret = false;
goto out;
}
@@ -246,30 +248,30 @@ bool run_cachestat_test(enum file_type t
ret = false;
goto close_fd;
}
- switch (type){
- case FILE_SHMEM:
- if (!write_exactly(fd, filesize)) {
- ksft_print_msg("Unable to write to file.\n");
- ret = false;
- goto close_fd;
- }
- break;
- case FILE_MMAP:
- char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (map == MAP_FAILED) {
- ksft_print_msg("mmap failed.\n");
- ret = false;
- goto close_fd;
- }
- for (int i = 0; i < filesize; i++) {
- map[i] = 'A';
- }
- break;
- default:
- ksft_print_msg("Unsupported file type.\n");
+ switch (type) {
+ case FILE_SHMEM:
+ if (!write_exactly(fd, filesize)) {
+ ksft_print_msg("Unable to write to file.\n");
ret = false;
goto close_fd;
- break;
+ }
+ break;
+ case FILE_MMAP:
+ char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE,
+ MAP_SHARED, fd, 0);
+
+ if (map == MAP_FAILED) {
+ ksft_print_msg("mmap failed.\n");
+ ret = false;
+ goto close_fd;
+ }
+ for (int i = 0; i < filesize; i++)
+ map[i] = 'A';
+ break;
+ default:
+ ksft_print_msg("Unsupported file type.\n");
+ ret = false;
+ goto close_fd;
}
syscall_ret = syscall(__NR_cachestat, fd, &cs_range, &cs, 0);
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation.patch
mm-remove-mm-io-mappingc-fix.patch
init-kconfig-restore-config_broken-help-text.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-02 18:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-02 18:37 [folded-merged] selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.