<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 11, 2022 at 1:46 PM Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">To get rid of many compiler warnings.<br>
<br>
Signed-off-by: Li Wang <<a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a>><br>
---<br>
lib/tst_cgroup.c | 2 +-<br>
lib/tst_memutils.c | 4 ++--<br>
lib/tst_timer_test.c | 4 ++--<br>
testcases/kernel/syscalls/fallocate/fallocate06.c | 2 +-<br>
4 files changed, 6 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/lib/tst_cgroup.c b/lib/tst_cgroup.c<br>
index 8cca0654d..57940ba09 100644<br>
--- a/lib/tst_cgroup.c<br>
+++ b/lib/tst_cgroup.c<br>
@@ -1116,7 +1116,7 @@ ssize_t safe_cg_read(const char *const file, const int lineno,<br>
prev_len = MIN(sizeof(prev_buf), (size_t)read_ret);<br>
}<br>
<br>
- out[MAX(read_ret, 0)] = '\0';<br>
+ out[MAX(read_ret, (ssize_t)0)] = '\0';<br>
<br>
return read_ret;<br>
}<br>
diff --git a/lib/tst_memutils.c b/lib/tst_memutils.c<br>
index 3741d6e6f..d95d75e5d 100644<br>
--- a/lib/tst_memutils.c<br>
+++ b/lib/tst_memutils.c<br>
@@ -30,7 +30,7 @@ void tst_pollute_memory(size_t maxsize, int fillchar)<br>
min_free += min_free / 10;<br>
<br>
SAFE_SYSINFO(&info);<br>
- safety = MAX(4096 * SAFE_SYSCONF(_SC_PAGESIZE), 128 * 1024 * 1024);<br>
+ safety = MAX(4096 * SAFE_SYSCONF(_SC_PAGESIZE), (long)128 * 1024 * 1024);<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">This should be 128L. and tst_timer_test has the same issue.</div><div class="gmail_default" style="font-size:small"><br></div>--- a/lib/tst_memutils.c<br>+++ b/lib/tst_memutils.c<br>@@ -30,7 +30,7 @@ void tst_pollute_memory(size_t maxsize, int fillchar)<br> min_free += min_free / 10;<br> <br> SAFE_SYSINFO(&info);<br>- safety = MAX(4096 * SAFE_SYSCONF(_SC_PAGESIZE), (long)128 * 1024 * 1024);<br>+ safety = MAX(4096 * SAFE_SYSCONF(_SC_PAGESIZE), 128L * 1024 * 1024);<br> safety = MAX(safety, min_free);<br> safety /= info.mem_unit;<br> <br>diff --git a/lib/tst_timer_test.c b/lib/tst_timer_test.c<br>index c0e3de3e7..32fa55c7c 100644<br>--- a/lib/tst_timer_test.c<br>+++ b/lib/tst_timer_test.c<br>@@ -184,7 +184,7 @@ static int cmp(const void *a, const void *b)<br> static long long compute_threshold(long long requested_us,<br> unsigned int nsamples)<br> {<br>- unsigned int slack_per_scall = MIN((long long)100000, requested_us / 1000);<br>+ unsigned int slack_per_scall = MIN(100000LL, requested_us / 1000);<br> <br> slack_per_scall = MAX(slack_per_scall, timerslack);<br><div class="gmail_default" style="font-size:small"><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>