From: John Kacur <jkacur@redhat.com>
To: RT <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [PATCH 15/17] rt-tests: pi_stress: Fix various warnings
Date: Fri, 6 Oct 2023 14:40:09 -0400 [thread overview]
Message-ID: <20231006184011.26699-15-jkacur@redhat.com> (raw)
In-Reply-To: <20231006184011.26699-1-jkacur@redhat.com>
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
next prev parent reply other threads:[~2023-10-06 18:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` [PATCH 04/17] rt-tests: queuelat: " John Kacur
2023-10-06 18:39 ` [PATCH 05/17] rt-tests: cyclicdeadline: Suppress unused parameter warning John Kacur
2023-10-06 18:40 ` [PATCH 06/17] rt-tests: svsematest: Suppress unused paramters warning John Kacur
2023-10-06 18:40 ` [PATCH 07/17] rt-tests: pip_stress: Removed unused parameter John Kacur
2023-10-06 18:40 ` [PATCH 08/17] rt-tests: sigwaittest: Fix some warnings John Kacur
2023-10-06 18:40 ` [PATCH 09/17] rt-tests: rt-migrate-test: " John Kacur
2023-10-06 18:40 ` [PATCH 10/17] rt-tests: signaltest Fix unused parameter warning John Kacur
2023-10-06 18:40 ` [PATCH 11/17] rt-tests: cyclicdeadline: Fix comparison of different signedness John Kacur
2023-10-06 18:40 ` [PATCH 12/17] rt-tests: cyclictest: " John Kacur
2023-10-06 18:40 ` [PATCH 13/17] rt-tests: rt-utils: Suppress warnings about fallthrough John Kacur
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 [this message]
2023-10-06 18:40 ` [PATCH 16/17] rt-tests: pmqtest: Fix various warnings John Kacur
2023-10-06 18:40 ` [PATCH 17/17] rt-tests: ptsematest: Fix unused paramter warnings John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231006184011.26699-15-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).