[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250820205513.103548-1-adelodunolaoluwa@yahoo.com>
Date: Wed, 20 Aug 2025 21:55:13 +0100
From: Sunday Adelodun <adelodunolaoluwa@...oo.com>
To: shuah@...nel.org
Cc: akpm@...ux-foundation.org,
linux-kselftest@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
surenb@...gle.com,
Sunday Adelodun <adelodunolaoluwa@...oo.com>
Subject: [PATCH] selftests/proc: Fix spelling in comments and improve error message
This patch corrects minor spelling mistake and adjusts comment style,
such as capitalizing the first letter for consistency.
In addition, "error: failed to find available memory address for mapping\n"
message replaces a not-quite-suitable one:"error: mmap doesn't like you\n".
No functional changes are introduced
Signed-off-by: Sunday Adelodun <adelodunolaoluwa@...oo.com>
---
tools/testing/selftests/proc/fd-001-lookup.c | 4 ++--
tools/testing/selftests/proc/proc-maps-race.c | 22 +++++++++----------
.../selftests/proc/proc-self-map-files-002.c | 2 +-
tools/testing/selftests/proc/read.c | 2 +-
tools/testing/selftests/proc/setns-dcache.c | 2 +-
tools/testing/selftests/proc/setns-sysvipc.c | 2 +-
6 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/tools/testing/selftests/proc/fd-001-lookup.c b/tools/testing/selftests/proc/fd-001-lookup.c
index 60d7948e7124..2f5949593ad4 100644
--- a/tools/testing/selftests/proc/fd-001-lookup.c
+++ b/tools/testing/selftests/proc/fd-001-lookup.c
@@ -60,7 +60,7 @@ static void test_lookup(unsigned int fd)
snprintf(buf, sizeof(buf), "/proc/self/fd/%u", fd);
test_lookup_pass(buf);
- /* leading junk */
+ /* Leading junk */
for (c = 1; c <= 255; c++) {
if (c == '/')
continue;
@@ -68,7 +68,7 @@ static void test_lookup(unsigned int fd)
test_lookup_fail(buf);
}
- /* trailing junk */
+ /* Trailing junk */
for (c = 1; c <= 255; c++) {
if (c == '/')
continue;
diff --git a/tools/testing/selftests/proc/proc-maps-race.c b/tools/testing/selftests/proc/proc-maps-race.c
index 94bba4553130..2e730b70b171 100644
--- a/tools/testing/selftests/proc/proc-maps-race.c
+++ b/tools/testing/selftests/proc/proc-maps-race.c
@@ -138,10 +138,10 @@ static void copy_last_line(struct page_content *page, char *last_line)
{
/* Get the last line in the first page */
const char *end = page->data + page->size - 1;
- /* skip last newline */
+ /* Skip last newline */
const char *pos = end - 1;
- /* search previous newline */
+ /* Search previous newline */
while (pos[-1] != '\n')
pos--;
strncpy(last_line, pos, end - pos);
@@ -412,7 +412,7 @@ FIXTURE_SETUP(proc_maps_race)
self->vma_count = self->page_size / 32 + 1;
self->shared_mem_size = sizeof(struct vma_modifier_info) + self->vma_count * sizeof(void *);
- /* map shared memory for communication with the child process */
+ /* Map shared memory for communication with the child process */
self->mod_info = (struct vma_modifier_info *)mmap(NULL, self->shared_mem_size,
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
ASSERT_NE(self->mod_info, MAP_FAILED);
@@ -439,7 +439,7 @@ FIXTURE_SETUP(proc_maps_race)
mod_info->child_mapped_addr[i] = mmap(NULL, self->page_size * 3, prot,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
ASSERT_NE(mod_info->child_mapped_addr[i], MAP_FAILED);
- /* change protection in adjacent maps to prevent merging */
+ /* Change protection in adjacent maps to prevent merging */
prot ^= PROT_WRITE;
}
signal_state(mod_info, CHILD_READY);
@@ -536,7 +536,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_split)
wait_for_state(mod_info, SETUP_READY);
- /* re-read the file to avoid using stale data from previous test */
+ /* Re-read the file to avoid using stale data from previous test */
ASSERT_TRUE(read_boundary_lines(self, &self->last_line, &self->first_line));
mod_info->vma_modify = split_vma;
@@ -600,7 +600,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_split)
} while (end_ts.tv_sec - start_ts.tv_sec < self->duration_sec);
end_test_loop(self->verbose);
- /* Signal the modifyer thread to stop and wait until it exits */
+ /* Signal the modifier thread to stop and wait until it exits */
signal_state(mod_info, TEST_DONE);
}
@@ -615,7 +615,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_resize)
wait_for_state(mod_info, SETUP_READY);
- /* re-read the file to avoid using stale data from previous test */
+ /* Re-read the file to avoid using stale data from previous test */
ASSERT_TRUE(read_boundary_lines(self, &self->last_line, &self->first_line));
mod_info->vma_modify = shrink_vma;
@@ -653,7 +653,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_resize)
strcmp(new_first_line.text, restored_last_line.text),
"Shrink result invalid", self));
} else {
- /* The vmas should be consistent with the original/resored state */
+ /* The vmas should be consistent with the original/restored state */
ASSERT_FALSE(print_boundaries_on(
strcmp(new_last_line.text, restored_last_line.text),
"Expand result invalid", self));
@@ -667,7 +667,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_resize)
} while (end_ts.tv_sec - start_ts.tv_sec < self->duration_sec);
end_test_loop(self->verbose);
- /* Signal the modifyer thread to stop and wait until it exits */
+ /* Signal the modifier thread to stop and wait until it exits */
signal_state(mod_info, TEST_DONE);
}
@@ -682,7 +682,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_remap)
wait_for_state(mod_info, SETUP_READY);
- /* re-read the file to avoid using stale data from previous test */
+ /* Re-read the file to avoid using stale data from previous test */
ASSERT_TRUE(read_boundary_lines(self, &self->last_line, &self->first_line));
mod_info->vma_modify = remap_vma;
@@ -734,7 +734,7 @@ TEST_F(proc_maps_race, test_maps_tearing_from_remap)
} while (end_ts.tv_sec - start_ts.tv_sec < self->duration_sec);
end_test_loop(self->verbose);
- /* Signal the modifyer thread to stop and wait until it exits */
+ /* Signal the modifier thread to stop and wait until it exits */
signal_state(mod_info, TEST_DONE);
}
diff --git a/tools/testing/selftests/proc/proc-self-map-files-002.c b/tools/testing/selftests/proc/proc-self-map-files-002.c
index e6aa00a183bc..ac05b0b127cd 100644
--- a/tools/testing/selftests/proc/proc-self-map-files-002.c
+++ b/tools/testing/selftests/proc/proc-self-map-files-002.c
@@ -67,7 +67,7 @@ int main(void)
break;
}
if (va == va_max) {
- fprintf(stderr, "error: mmap doesn't like you\n");
+ fprintf(stderr, "error: failed to find available memory address for mapping\n");
return 1;
}
diff --git a/tools/testing/selftests/proc/read.c b/tools/testing/selftests/proc/read.c
index 35ee78dff144..84f6f2e01150 100644
--- a/tools/testing/selftests/proc/read.c
+++ b/tools/testing/selftests/proc/read.c
@@ -41,7 +41,7 @@ static void f_reg(DIR *d, const char *filename)
int fd;
ssize_t rv;
- /* read from /proc/kmsg can block */
+ /* Read from /proc/kmsg can block */
fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK);
if (fd == -1)
return;
diff --git a/tools/testing/selftests/proc/setns-dcache.c b/tools/testing/selftests/proc/setns-dcache.c
index 60ab197a73fc..70389832dd22 100644
--- a/tools/testing/selftests/proc/setns-dcache.c
+++ b/tools/testing/selftests/proc/setns-dcache.c
@@ -50,7 +50,7 @@ int main(void)
atexit(f);
- /* Check for priviledges and syscall availability straight away. */
+ /* Check for privileges and syscall availability straight away. */
if (unshare(CLONE_NEWNET) == -1) {
if (errno == ENOSYS || errno == EPERM) {
return 4;
diff --git a/tools/testing/selftests/proc/setns-sysvipc.c b/tools/testing/selftests/proc/setns-sysvipc.c
index 903890c5e587..d03aa4838f0f 100644
--- a/tools/testing/selftests/proc/setns-sysvipc.c
+++ b/tools/testing/selftests/proc/setns-sysvipc.c
@@ -49,7 +49,7 @@ int main(void)
atexit(f);
- /* Check for priviledges and syscall availability straight away. */
+ /* Check for privileges and syscall availability straight away. */
if (unshare(CLONE_NEWIPC) == -1) {
if (errno == ENOSYS || errno == EPERM) {
return 4;
--
2.43.0
Powered by blists - more mailing lists