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>
This commit is contained in:
committed by
Shuah Khan
parent
41f37c852a
commit
99338cc1e4
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user