From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,suresh.k.chandrappa@gmail.com,shuah@kernel.org,nphamcs@gmail.com,joshua.hahnjy@gmail.com,hannes@cmpxchg.org,akpm@linux-foundation.org,akpm@linux-foundation.org
Subject: [folded-merged] selftests-cachestat-add-tests-for-mmap-refactor-and-enhance-mmap-test-for-cachestat-validation-checkpatch-fixes.patch removed from -mm tree
Date: Sat, 02 Aug 2025 11:37:07 -0700 [thread overview]
Message-ID: <20250802183708.9C8ECC4CEEF@smtp.kernel.org> (raw)
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
reply other threads:[~2025-08-02 18:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250802183708.9C8ECC4CEEF@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=joshua.hahnjy@gmail.com \
--cc=mm-commits@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=shuah@kernel.org \
--cc=suresh.k.chandrappa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.