* [PATCH v2] rt-tests: cyclictest: Remove warnings due different signedness in comparison
@ 2023-08-11 15:42 Eder Zulian
2023-09-18 15:12 ` John Kacur
0 siblings, 1 reply; 2+ messages in thread
From: Eder Zulian @ 2023-08-11 15:42 UTC (permalink / raw)
To: linux-rt-users; +Cc: jkacur, williams, Eder Zulian
Type casting used to remove compiler warnings due to comparison of
integer expressions of different signedness.
Signed-off-by: Eder Zulian <ezulian@redhat.com>
---
v2: Cleaned up coding style and addressed review comments
src/cyclictest/cyclictest.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 4a7108e..179ae8b 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;
--
2.39.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] rt-tests: cyclictest: Remove warnings due different signedness in comparison
2023-08-11 15:42 [PATCH v2] rt-tests: cyclictest: Remove warnings due different signedness in comparison Eder Zulian
@ 2023-09-18 15:12 ` John Kacur
0 siblings, 0 replies; 2+ messages in thread
From: John Kacur @ 2023-09-18 15:12 UTC (permalink / raw)
To: Eder Zulian; +Cc: linux-rt-users, williams
On Fri, 11 Aug 2023, Eder Zulian wrote:
> Type casting used to remove compiler warnings due to comparison of
> integer expressions of different signedness.
>
> Signed-off-by: Eder Zulian <ezulian@redhat.com>
> ---
> v2: Cleaned up coding style and addressed review comments
>
> src/cyclictest/cyclictest.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
> index 4a7108e..179ae8b 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;
> --
> 2.39.3
>
>
Signed-off-by: John Kacur <jkacur@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-18 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 15:42 [PATCH v2] rt-tests: cyclictest: Remove warnings due different signedness in comparison Eder Zulian
2023-09-18 15:12 ` John Kacur
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).