]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/mqueue: fix 5 warnings about signed/unsigned mismatches
authorJohn Hubbard <jhubbard@nvidia.com>
Mon, 27 May 2024 20:08:35 +0000 (13:08 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:25:03 +0000 (22:25 -0700)
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>
tools/testing/selftests/mqueue/mq_perf_tests.c

index 5c16159d0bcd7f25adb53c0760af3310844b5784..fb898850867c37cc5324bc410249bf65b48129f2 100644 (file)
@@ -323,7 +323,8 @@ void *fake_cont_thread(void *arg)
 void *cont_thread(void *arg)
 {
        char buff[MSG_SIZE];
-       int i, priority;
+       int i;
+       unsigned int priority;
 
        for (i = 0; i < num_cpus_to_pin; i++)
                if (cpu_threads[i] == pthread_self())
@@ -425,7 +426,8 @@ struct test test2[] = {
 void *perf_test_thread(void *arg)
 {
        char buff[MSG_SIZE];
-       int prio_out, prio_in;
+       int prio_out;
+       unsigned int prio_in;
        int i;
        clockid_t clock;
        pthread_t *t;