Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@linuxfoundation.org>
Signed-off-by: Piotr Zalewski <pZ010001011111@proton.me>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Piotr Zalewski and committed by
Shuah Khan
99338cc1 41f37c85

+2 -2
+2 -2
tools/testing/selftests/timers/threadtest.c
··· 38 38 int listcount = 0; 39 39 40 40 41 - void checklist(struct timespec *list, int size) 41 + void checklist(const struct timespec *list, int size) 42 42 { 43 43 int i, j; 44 - struct timespec *a, *b; 44 + const struct timespec *a, *b; 45 45 46 46 /* scan the list */ 47 47 for (i = 0; i < size-1; i++) {