lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250517020658.358461-1-contact@gvernon.com>
Date: Sat, 17 May 2025 03:06:56 +0100
From: George Anthony Vernon <contact@...rnon.com>
To: akpm@...ux-foundation.org,
	shuah@...nel.org,
	skhan@...uxfoundation.org
Cc: George Anthony Vernon <contact@...rnon.com>,
	linux-mm@...ck.org,
	linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-kernel-mentees@...ts.linux.dev
Subject: [PATCH] selftests/mm: compaction_test: convert comments to preferred style

Convert multi-line comments to preferred style with beginning and ending
almost-blank lines.

Signed-off-by: George Anthony Vernon <contact@...rnon.com>
---
 tools/testing/selftests/mm/compaction_test.c | 22 +++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/mm/compaction_test.c b/tools/testing/selftests/mm/compaction_test.c
index 2c3a0eb6b22d..b217ec4a434b 100644
--- a/tools/testing/selftests/mm/compaction_test.c
+++ b/tools/testing/selftests/mm/compaction_test.c
@@ -1,6 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- *
  * A test for the patch "Allow compaction of unevictable pages".
  * With this patch we should be able to allocate at least 1/4
  * of RAM in huge pages. Without the patch much less is
@@ -94,8 +93,10 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size,
 	snprintf(init_nr_hugepages, sizeof(init_nr_hugepages),
 		 "%lu", initial_nr_hugepages);
 
-	/* We want to test with 80% of available memory. Else, OOM killer comes
-	   in to play */
+	/*
+	 * We want to test with 80% of available memory. Else, OOM killer comes
+	 * in to play
+	 */
 	mem_free = mem_free * 0.8;
 
 	fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
@@ -106,8 +107,10 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size,
 		goto out;
 	}
 
-	/* Request a large number of huge pages. The Kernel will allocate
-	   as much as it can */
+	/*
+	 * Request a large number of huge pages. The Kernel will allocate
+	 * as much as it can
+	 */
 	if (write(fd, "100000", (6*sizeof(char))) != (6*sizeof(char))) {
 		ksft_print_msg("Failed to write 100000 to /proc/sys/vm/nr_hugepages: %s\n",
 			       strerror(errno));
@@ -122,8 +125,10 @@ int check_compaction(unsigned long mem_free, unsigned long hugepage_size,
 		goto close_fd;
 	}
 
-	/* We should have been able to request at least 1/3 rd of the memory in
-	   huge pages */
+	/*
+	 * We should have been able to request at least 1/3 rd of the memory in
+	 * huge pages
+	 */
 	nr_hugepages_ul = strtoul(nr_hugepages, NULL, 10);
 	if (!nr_hugepages_ul) {
 		ksft_print_msg("ERROR: No memory is available as huge pages\n");
@@ -243,7 +248,8 @@ int main(int argc, char **argv)
 		entry->next = list;
 		list = entry;
 
-		/* Write something (in this case the address of the map) to
+		/*
+		 * Write something (in this case the address of the map) to
 		 * ensure that KSM can't merge the mapped pages
 		 */
 		for (i = 0; i < MAP_SIZE; i += page_size)
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ