From: Piotr Zalewski Date: Mon, 19 Aug 2024 17:58:34 +0000 (+0000) Subject: kselftest: timers: Fix const correctness X-Git-Tag: v6.12-rc1~171^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99338cc1e47187c3efdd39cda2a31500d0f2305d;p=thirdparty%2Flinux.git 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 Signed-off-by: Piotr Zalewski Acked-by: John Stultz Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/timers/threadtest.c b/tools/testing/selftests/timers/threadtest.c index 76b38e41d9c7f..d5564bbf0e50d 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++) {