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

selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

When building with clang, via:

make LLVM=1 -C tools/testing/selftest

...clang warns about several cases of using a signed integer for the
priority argument to mq_receive(3), which expects an unsigned int.

Fix this by declaring the type as unsigned int in all cases.

Link: https://lkml.kernel.org/r/20240527200835.143682-1-jhubbard@nvidia.com
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Valentin Obst <kernel@valentinobst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

John Hubbard and committed by
Andrew Morton
727759d7 54ce43da

+4 -2
+4 -2
tools/testing/selftests/mqueue/mq_perf_tests.c
··· 323 323 void *cont_thread(void *arg) 324 324 { 325 325 char buff[MSG_SIZE]; 326 - int i, priority; 326 + int i; 327 + unsigned int priority; 327 328 328 329 for (i = 0; i < num_cpus_to_pin; i++) 329 330 if (cpu_threads[i] == pthread_self()) ··· 426 425 void *perf_test_thread(void *arg) 427 426 { 428 427 char buff[MSG_SIZE]; 429 - int prio_out, prio_in; 428 + int prio_out; 429 + unsigned int prio_in; 430 430 int i; 431 431 clockid_t clock; 432 432 pthread_t *t;