Skip to content

Commit 99338cc

Browse files
JungerBoyoshuahkh
authored andcommitted
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>
1 parent 41f37c8 commit 99338cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/timers/threadtest.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ struct timespec global_list[LISTSIZE];
3838
int listcount = 0;
3939

4040

41-
void checklist(struct timespec *list, int size)
41+
void checklist(const struct timespec *list, int size)
4242
{
4343
int i, j;
44-
struct timespec *a, *b;
44+
const struct timespec *a, *b;
4545

4646
/* scan the list */
4747
for (i = 0; i < size-1; i++) {

0 commit comments

Comments
 (0)