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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240819174814.139344-3-pZ010001011111@proton.me>
Date: Mon, 19 Aug 2024 17:58:34 +0000
From: Piotr Zalewski <pZ010001011111@...ton.me>
To: anna-maria@...utronix.de, frederic@...nel.org, tglx@...utronix.de, jstultz@...gle.com, sboyd@...nel.org, shuah@...nel.org, linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Cc: Piotr Zalewski <pZ010001011111@...ton.me>, Shuah Khan <skhan@...uxfoundation.org>
Subject: [PATCH] kselftest: timers: Fix const correctness

Make timespec pointers, pointers to const in checklist function. As a
consequence, make list parameter in checklist function pointer to const
as well. Const-correctness increases readability.

Improvement was found by running cppcheck tool on the patched file as
follows:
```
cppcheck --enable=all \
	tools/testing/selftests/timers/threadtest.c \
	--suppress=missingIncludeSystem \
	--suppress=unusedFunction
```

Reviewed-by: Shuah Khan <skhan@...uxfoundation.org>
Signed-off-by: Piotr Zalewski <pZ010001011111@...ton.me>
---
 tools/testing/selftests/timers/threadtest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/timers/threadtest.c b/tools/testing/selftests/timers/threadtest.c
index 76b38e41d9c7..d5564bbf0e50 100644
--- a/tools/testing/selftests/timers/threadtest.c
+++ b/tools/testing/selftests/timers/threadtest.c
@@ -38,10 +38,10 @@ struct timespec global_list[LISTSIZE];
 int listcount = 0;
 
 
-void checklist(struct timespec *list, int size)
+void checklist(const struct timespec *list, int size)
 {
 	int i, j;
-	struct timespec *a, *b;
+	const struct timespec *a, *b;
 
 	/* scan the list */
 	for (i = 0; i < size-1; i++) {
-- 
2.46.0



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ