* [PATCH 02/17] rt-tests: cyclictest: Suppress unused parameters warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
@ 2023-10-06 18:39 ` John Kacur
2023-10-06 18:39 ` [PATCH 03/17] rt-tests: ssdd: " John Kacur
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:39 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress unused parameters warning in cyclictest with __attribute__ ((unused))
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 179ae8b2004b..2542cb5ecdce 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1616,7 +1616,7 @@ static void rstat_print_stat(struct thread_param *par, int index, int verbose, i
* thread that creates a named fifo and hands out run stats when someone
* reads from the fifo.
*/
-static void *fifothread(void *param)
+static void *fifothread(void *param __attribute__ ((unused)))
{
int ret;
int fd;
@@ -1797,7 +1797,7 @@ rstat_err:
return;
}
-static void write_stats(FILE *f, void *data)
+static void write_stats(FILE *f, void *data __attribute__ ((unused)))
{
struct thread_param **par = parameters;
unsigned int i, j, comma;
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 03/17] rt-tests: ssdd: Suppress unused parameters warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
2023-10-06 18:39 ` [PATCH 02/17] rt-tests: cyclictest: Suppress unused parameters warning John Kacur
@ 2023-10-06 18:39 ` John Kacur
2023-10-06 18:39 ` [PATCH 04/17] rt-tests: queuelat: " John Kacur
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:39 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress unused parameters warning in ssdd with __attribute__ ((unused))
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/ssdd/ssdd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/ssdd/ssdd.c b/src/ssdd/ssdd.c
index c5307648a82d..cad901b563d8 100644
--- a/src/ssdd/ssdd.c
+++ b/src/ssdd/ssdd.c
@@ -64,8 +64,6 @@ static const char *get_state_name(int state)
return state_name[state];
}
-#define unused __attribute__((unused))
-
static int quiet;
static char jsonfile[MAX_PATH];
@@ -154,7 +152,7 @@ static pid_t parent;
static int nforks = 10;
static int nsteps = 10000;
-static void sigchld(int sig, unused siginfo_t *info, unused void *arg)
+static void sigchld(int sig __attribute__ ((unused)), siginfo_t *info __attribute__ ((unused)), void *arg __attribute__ ((unused)))
{
got_sigchld = 1;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 04/17] rt-tests: queuelat: Suppress unused parameters warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
2023-10-06 18:39 ` [PATCH 02/17] rt-tests: cyclictest: Suppress unused parameters warning John Kacur
2023-10-06 18:39 ` [PATCH 03/17] rt-tests: ssdd: " John Kacur
@ 2023-10-06 18:39 ` John Kacur
2023-10-06 18:39 ` [PATCH 05/17] rt-tests: cyclicdeadline: Suppress unused parameter warning John Kacur
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:39 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress unused paramters warning in queuelat
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/queuelat/queuelat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c
index ead8ee5f4898..c549cd8381ab 100644
--- a/src/queuelat/queuelat.c
+++ b/src/queuelat/queuelat.c
@@ -519,7 +519,7 @@ void main_loop(void)
free(src);
}
-void sig_handler(int sig)
+void sig_handler(int sig __attribute__ ((unused)))
{
print_exit_info();
exit(0);
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 05/17] rt-tests: cyclicdeadline: Suppress unused parameter warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (2 preceding siblings ...)
2023-10-06 18:39 ` [PATCH 04/17] rt-tests: queuelat: " John Kacur
@ 2023-10-06 18:39 ` John Kacur
2023-10-06 18:40 ` [PATCH 06/17] rt-tests: svsematest: Suppress unused paramters warning John Kacur
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:39 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress unused parameter warning in cyclicdeadline
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/sched_deadline/cyclicdeadline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index ef00a0d6b2dd..b477cc7aa8ff 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -1030,7 +1030,7 @@ static int calc_nr_cpus(const char *setcpu, char **buf)
return -1;
}
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
shutdown = 1;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 06/17] rt-tests: svsematest: Suppress unused paramters warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (3 preceding siblings ...)
2023-10-06 18:39 ` [PATCH 05/17] rt-tests: cyclicdeadline: Suppress unused parameter warning John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 07/17] rt-tests: pip_stress: Removed unused parameter John Kacur
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress unused paramters warnings in svsematest
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/svsematest/svsematest.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c
index 243b13738b19..3c857dcb0189 100644
--- a/src/svsematest/svsematest.c
+++ b/src/svsematest/svsematest.c
@@ -416,7 +416,7 @@ static void process_options(int argc, char *argv[])
static int volatile mustshutdown;
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
mustshutdown = 1;
}
@@ -430,7 +430,7 @@ static void write_stats(FILE *f, void *data)
{
struct params_stats *ps = data;
struct params *s, *r;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
fprintf(f, " \"thread\": {\n");
@@ -456,8 +456,7 @@ static void write_stats(FILE *f, void *data)
fprintf(f, " }\n");
}
-static void print_stat(FILE *fp, struct params *receiver, struct params *sender,
- int verbose, int quiet)
+static void print_stat(FILE *fp __attribute__ ((unused)), struct params *receiver, struct params *sender, int verbose __attribute__ ((unused)), int quiet)
{
int i;
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 07/17] rt-tests: pip_stress: Removed unused parameter
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (4 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 06/17] rt-tests: svsematest: Suppress unused paramters warning John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 08/17] rt-tests: sigwaittest: Fix some warnings John Kacur
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Removed unused parameter in pip_stress
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/include/pip_stress.h | 2 +-
src/pi_tests/pip_stress.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/include/pip_stress.h b/src/include/pip_stress.h
index f03aaf397897..84a7c0ceef7f 100644
--- a/src/include/pip_stress.h
+++ b/src/include/pip_stress.h
@@ -32,7 +32,7 @@ void Pthread_mutex_init(pthread_mutex_t *mutex, pthread_mutexattr_t *attr);
void Pthread_mutex_lock(pthread_mutex_t *mutex);
void Pthread_mutex_unlock(pthread_mutex_t *mutex);
-void init_shared_pthread_mutex(pthread_mutex_t *mutex, int protocol, int policy);
+void init_shared_pthread_mutex(pthread_mutex_t *mutex, int protocol);
int set_rt_prio(pid_t pid, int prio, int policy);
int get_rt_prio(pid_t pid);
diff --git a/src/pi_tests/pip_stress.c b/src/pi_tests/pip_stress.c
index c6d2bae05035..fb0391bfec0d 100644
--- a/src/pi_tests/pip_stress.c
+++ b/src/pi_tests/pip_stress.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
mptr += sizeof(pthread_mutex_t); /* advance the memory pointer */
/* Initialize our mutex via the resource pointer */
- init_shared_pthread_mutex(resource, PTHREAD_PRIO_INHERIT, policy);
+ init_shared_pthread_mutex(resource, PTHREAD_PRIO_INHERIT);
statep = (struct State*)mptr;
mptr += sizeof(struct State);
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
mptr += sizeof(pthread_mutex_t); /* advance the memory pointer */
/* Initialize our State mutex */
- init_shared_pthread_mutex(statep->mutex, PTHREAD_PRIO_NONE, policy);
+ init_shared_pthread_mutex(statep->mutex, PTHREAD_PRIO_NONE);
set_rt_prio(0, prio_min, policy);
@@ -323,7 +323,7 @@ void Pthread_mutex_unlock(pthread_mutex_t *mutex)
}
}
-void init_shared_pthread_mutex(pthread_mutex_t *mutex, int protocol, int policy)
+void init_shared_pthread_mutex(pthread_mutex_t *mutex, int protocol)
{
pthread_mutexattr_t attr;
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 08/17] rt-tests: sigwaittest: Fix some warnings
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (5 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 07/17] rt-tests: pip_stress: Removed unused parameter John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 09/17] rt-tests: rt-migrate-test: " John Kacur
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix some warnings about unused parameters and comparisons of integers of
different signedness
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/sigwaittest/sigwaittest.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c
index 728176a0b385..818e3a8e680a 100644
--- a/src/sigwaittest/sigwaittest.c
+++ b/src/sigwaittest/sigwaittest.c
@@ -384,13 +384,13 @@ static void process_options(int argc, char *argv[])
static int volatile mustshutdown;
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
mustshutdown = 1;
}
static void print_stat(FILE *fp, struct params *receiver, struct params *sender,
- int verbose, int quiet)
+ int verbose __attribute__ ((unused)), int quiet)
{
int i;
@@ -435,7 +435,7 @@ static void write_stats(FILE *f, void *data)
{
struct params_stats *ps = data;
struct params *s, *r;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
fprintf(f, " \"thread\": {\n");
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 09/17] rt-tests: rt-migrate-test: Fix some warnings
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (6 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 08/17] rt-tests: sigwaittest: Fix some warnings John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 10/17] rt-tests: signaltest Fix unused parameter warning John Kacur
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
- Use attribute unused where appropriate
- Change unsigned int to int for comparision
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/rt-migrate-test/rt-migrate-test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c
index 883e60e21bff..7b1917df12a3 100644
--- a/src/rt-migrate-test/rt-migrate-test.c
+++ b/src/rt-migrate-test/rt-migrate-test.c
@@ -44,7 +44,7 @@ static void setup_ftrace_marker(void)
"/debugfs/tracing/trace_marker",
};
int ret;
- int i;
+ unsigned int i;
for (i = 0; i < (sizeof(files) / sizeof(char *)); i++) {
ret = stat(files[i], &st);
@@ -354,7 +354,7 @@ static void print_results(void)
}
}
-static void write_stats(FILE *f, void *data)
+static void write_stats(FILE *f, void *data __attribute__ ((unused)))
{
int i;
int t;
@@ -489,7 +489,7 @@ static int check_times(int l)
return 0;
}
-static void stop_log(int sig)
+static void stop_log(int sig __attribute__ ((unused)))
{
stop = 1;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 10/17] rt-tests: signaltest Fix unused parameter warning
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (7 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 09/17] rt-tests: rt-migrate-test: " John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 11/17] rt-tests: cyclicdeadline: Fix comparison of different signedness John Kacur
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix unused parameter warning in signal handler
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/signaltest/signaltest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 1cf03931b5bf..4737c253b1af 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -357,7 +357,7 @@ static void process_options(int argc, char *argv[], unsigned int max_cpus)
}
}
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
shutdown = 1;
}
@@ -388,7 +388,7 @@ static void write_stats(FILE *f, void *data)
{
struct thread_param *par = data;
struct thread_stat *s;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
fprintf(f, " \"thread\": {\n");
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 11/17] rt-tests: cyclicdeadline: Fix comparison of different signedness
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (8 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 10/17] rt-tests: signaltest Fix unused parameter warning John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 12/17] rt-tests: cyclictest: " John Kacur
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix comparison of integer expressions of different signedness
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/sched_deadline/cyclicdeadline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c
index b477cc7aa8ff..9bdc4b5deaf1 100644
--- a/src/sched_deadline/cyclicdeadline.c
+++ b/src/sched_deadline/cyclicdeadline.c
@@ -1067,7 +1067,7 @@ static void write_stats(FILE *f, void *data)
{
struct sched_data *sd = data;
struct thread_stat *s;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", nr_threads);
fprintf(f, " \"resolution_in_ns\": %u,\n", use_nsecs);
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 12/17] rt-tests: cyclictest: Fix comparison of different signedness
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (9 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 11/17] rt-tests: cyclicdeadline: Fix comparison of different signedness John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 13/17] rt-tests: rt-utils: Suppress warnings about fallthrough John Kacur
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix comparison of integer expressions of different signedness
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 2542cb5ecdce..a8039b49feb6 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1800,7 +1800,8 @@ rstat_err:
static void write_stats(FILE *f, void *data __attribute__ ((unused)))
{
struct thread_param **par = parameters;
- unsigned int i, j, comma;
+ int i, j;
+ unsigned comma;
struct thread_stat *s;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 13/17] rt-tests: rt-utils: Suppress warnings about fallthrough
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (10 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 12/17] rt-tests: cyclictest: " John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 14/17] rt-tests: rt-numa: Fix comparison of different signedness John Kacur
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Suppress warnings about fallthrough in a case statement where this
is intended.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/lib/rt-utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c
index 14dac5608037..6bbd25a8ba53 100644
--- a/src/lib/rt-utils.c
+++ b/src/lib/rt-utils.c
@@ -382,12 +382,15 @@ int parse_mem_string(char *str, uint64_t *val)
case 'g':
case 'G':
v *= 1024;
+ __attribute__ ((fallthrough));
case 'm':
case 'M':
v *= 1024;
+ __attribute__ ((fallthrough));
case 'k':
case 'K':
v *= 1024;
+ __attribute__ ((fallthrough));
case 'b':
case 'B':
break;
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 14/17] rt-tests: rt-numa: Fix comparison of different signedness
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (11 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 13/17] rt-tests: rt-utils: Suppress warnings about fallthrough John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 15/17] rt-tests: pi_stress: Fix various warnings John Kacur
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix comparison of integer expressions of different signedness
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/lib/rt-numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/rt-numa.c b/src/lib/rt-numa.c
index 1b09cff8d948..548365f50cc4 100644
--- a/src/lib/rt-numa.c
+++ b/src/lib/rt-numa.c
@@ -52,7 +52,7 @@ int get_available_cpus(struct bitmask *cpumask)
int cpu_for_thread_sp(int thread_num, int max_cpus, struct bitmask *cpumask)
{
- unsigned int m, cpu, i, num_cpus;
+ int m, cpu, i, num_cpus;
num_cpus = numa_bitmask_weight(cpumask);
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 15/17] rt-tests: pi_stress: Fix various warnings
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (12 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 14/17] rt-tests: rt-numa: Fix comparison of different signedness John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 16/17] rt-tests: pmqtest: " John Kacur
2023-10-06 18:40 ` [PATCH 17/17] rt-tests: ptsematest: Fix unused paramter warnings John Kacur
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix unused parameter
Fix comparison of integer expressions of different signedness
with casts that are safe because the parameters are first tested
to see if they are less than zero
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/pi_tests/pi_stress.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c
index 9ce7d66751da..673a7bb472d8 100644
--- a/src/pi_tests/pi_stress.c
+++ b/src/pi_tests/pi_stress.c
@@ -505,7 +505,7 @@ int pending_interrupt(void)
* 1. report progress
* 2. check for deadlocks
*/
-void *reporter(void *arg)
+void *reporter(void *arg __attribute__ ((unused)))
{
int status;
int end = 0;
@@ -637,7 +637,7 @@ void *low_priority(void *arg)
We can't set the 'loop' boolean here, because some flags
may have already reached the loop_barr
*/
- if (!unbounded && (p->total >= p->inversions)) {
+ if (!unbounded && (p->total >= (unsigned)p->inversions)) {
set_shutdown_flag();
}
@@ -766,7 +766,7 @@ void *med_priority(void *arg)
pi_debug("med_priority[%d]: starting inversion loop\n", p->id);
for (;;) {
- if (!unbounded && (p->total >= p->inversions)) {
+ if (!unbounded && (p->total >= (unsigned)p->inversions)) {
set_shutdown_flag();
}
/* Either all threads go through the loop_barr, or none do */
@@ -891,7 +891,7 @@ void *high_priority(void *arg)
unbounded = (p->inversions < 0);
pi_debug("high_priority[%d]: starting inversion loop\n", p->id);
for (;;) {
- if (!unbounded && (p->total >= p->inversions)) {
+ if (!unbounded && (p->total >= (unsigned)p->inversions)) {
set_shutdown_flag();
}
@@ -1449,7 +1449,7 @@ void summary(void)
t->tm_yday, t->tm_hour, t->tm_min, t->tm_sec);
}
-void write_stats(FILE *f, void *data)
+void write_stats(FILE *f, void *data __attribute__ ((unused)))
{
fprintf(f, " \"inversion\": %lu\n", total_inversions());
}
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 16/17] rt-tests: pmqtest: Fix various warnings
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (13 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 15/17] rt-tests: pi_stress: Fix various warnings John Kacur
@ 2023-10-06 18:40 ` John Kacur
2023-10-06 18:40 ` [PATCH 17/17] rt-tests: ptsematest: Fix unused paramter warnings John Kacur
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix unused parameter warnings
Fix comparison of integer expressions of different signedness
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/pmqtest/pmqtest.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
index 9e142787d8b4..b21dfa0fe0cc 100644
--- a/src/pmqtest/pmqtest.c
+++ b/src/pmqtest/pmqtest.c
@@ -418,13 +418,14 @@ static void process_options(int argc, char *argv[])
static int volatile shutdown;
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
shutdown = 1;
}
-static void print_stat(FILE *fp, struct params *receiver, struct params *sender,
- int verbose, int quiet)
+static void print_stat(FILE *fp __attribute__ ((unused)),
+ struct params *receiver, struct params *sender,
+ int verbose __attribute__ ((unused)), int quiet)
{
int i;
@@ -456,7 +457,7 @@ static void write_stats(FILE *f, void *data)
{
struct params_stats *ps = data;
struct params *s, *r;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
fprintf(f, " \"thread\": {\n");
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH 17/17] rt-tests: ptsematest: Fix unused paramter warnings
2023-10-06 18:39 [PATCH 01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison John Kacur
` (14 preceding siblings ...)
2023-10-06 18:40 ` [PATCH 16/17] rt-tests: pmqtest: " John Kacur
@ 2023-10-06 18:40 ` John Kacur
15 siblings, 0 replies; 17+ messages in thread
From: John Kacur @ 2023-10-06 18:40 UTC (permalink / raw)
To: RT; +Cc: Clark Williams, John Kacur
Fix unused paramter warnings
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/ptsematest/ptsematest.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c
index a9d6c69b6449..5a29718d7bfb 100644
--- a/src/ptsematest/ptsematest.c
+++ b/src/ptsematest/ptsematest.c
@@ -321,13 +321,14 @@ static void process_options(int argc, char *argv[])
static int volatile shutdown;
-static void sighand(int sig)
+static void sighand(int sig __attribute__ ((unused)))
{
shutdown = 1;
}
-static void print_stat(FILE *fp, struct params *receiver, struct params *sender,
- int verbose, int quiet)
+static void print_stat(FILE *fp __attribute__ ((unused)),
+ struct params *receiver, struct params *sender,
+ int verbose __attribute__ ((unused)), int quiet)
{
int i;
@@ -359,7 +360,7 @@ static void write_stats(FILE *f, void *data)
{
struct params_stats *ps = data;
struct params *s, *r;
- unsigned int i;
+ int i;
fprintf(f, " \"num_threads\": %d,\n", num_threads);
fprintf(f, " \"thread\": {\n");
--
2.40.1
^ permalink raw reply related [flat|nested] 17+ messages in thread