[Devel] [PATCH RHEL10 COMMIT] selftests/mqueue: fix warnings in mq_perf_tests

Konstantin Khorenko khorenko at virtuozzo.com
Tue Mar 31 23:33:56 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-55.52.1.4.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-55.52.1.4.12.vz10
------>
commit b60a3925ac24470027d876dd9c2f1318c9525603
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Mar 23 21:31:29 2026 +0100

    selftests/mqueue: fix warnings in mq_perf_tests
    
      mq_perf_tests.c: In function 'perf_test_thread':
      mq_perf_tests.c:433:20: warning: variable 't' set but not used [-Wunused-but-set-variable]
        433 |         pthread_t *t;
            |                    ^
      mq_perf_tests.c: At top level:
      mq_perf_tests.c:45:14: warning: 'usage' defined but not used [-Wunused-variable]
         45 | static char *usage =
            |              ^~~~~
    
    - Mark 'usage' with __attribute__((unused)) to fix -Wunused-variable.
    - Remove unused variable 't' to fix -Wunused-but-set-variable.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-127529
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
    Reviewed-by: Vasileios Almpanis <vasileios.almpanis at virtuozzo.com>
    
    Feature: fix selftests
---
 tools/testing/selftests/mqueue/mq_perf_tests.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/testing/selftests/mqueue/mq_perf_tests.c b/tools/testing/selftests/mqueue/mq_perf_tests.c
index fb898850867c3..8557a968aa6a2 100644
--- a/tools/testing/selftests/mqueue/mq_perf_tests.c
+++ b/tools/testing/selftests/mqueue/mq_perf_tests.c
@@ -42,7 +42,7 @@
 
 #include "../kselftest.h"
 
-static char *usage =
+static char __attribute__((unused)) *usage =
 "Usage:\n"
 "  %s [-c #[,#..] -f] path\n"
 "\n"
@@ -430,12 +430,10 @@ void *perf_test_thread(void *arg)
 	unsigned int prio_in;
 	int i;
 	clockid_t clock;
-	pthread_t *t;
 	struct timespec res, start, middle, end, send_total, recv_total;
 	unsigned long long nsec;
 	struct test *cur_test;
 
-	t = &cpu_threads[0];
 	printf("\n\tStarted mqueue performance test thread on CPU %d\n",
 	       cpus_to_pin[0]);
 	mq_prio_max = sysconf(_SC_MQ_PRIO_MAX);


More information about the Devel mailing list