diff mbox series

[01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison

Message ID 20231006184011.26699-1-jkacur@redhat.com
State New
Headers show
Series [01/17] rt-tests: cyclictest: Remove warnings due different signedness in comparison | expand

Commit Message

John Kacur Oct. 6, 2023, 6:39 p.m. UTC
From: Eder Zulian <ezulian@redhat.com>

Type casting used to remove compiler warnings due to comparison of
integer expressions of different signedness.

Signed-off-by: Eder Zulian <ezulian@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/cyclictest/cyclictest.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 4a7108ea2c8f..179ae8b2004b 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -317,8 +317,10 @@  static int raise_soft_prio(int policy, const struct sched_param *param)
 		return err;
 	}
 
-	soft_max = (rlim.rlim_cur == RLIM_INFINITY) ? policy_max : rlim.rlim_cur;
-	hard_max = (rlim.rlim_max == RLIM_INFINITY) ? policy_max : rlim.rlim_max;
+	soft_max = (rlim.rlim_cur == RLIM_INFINITY) ? (unsigned int)policy_max
+						    : rlim.rlim_cur;
+	hard_max = (rlim.rlim_max == RLIM_INFINITY) ? (unsigned int)policy_max
+						    : rlim.rlim_max;
 
 	if (prio > soft_max && prio <= hard_max) {
 		rlim.rlim_cur = prio;