Skip to content

Commit 52e2dad

Browse files
Guixiong Wei via ltpacerv
authored andcommitted
syscalls/ipc: shmctl04: Fix shm_info print formats
Use %lu when printing unsigned long counters parsed from /proc and cast shm_info fields to match the format specifiers. Signed-off-by: Guixiong Wei <weiguixiong@bytedance.com> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
1 parent 96ce86d commit 52e2dad

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

testcases/kernel/syscalls/ipc/shmctl/shmctl04.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,24 @@ static void parse_proc_sysvipc(struct shm_info *info)
8686
}
8787

8888
if (info->shm_rss != shm_rss) {
89-
tst_res(TFAIL, "shm_rss = %li, expected %li",
89+
tst_res(TFAIL, "shm_rss = %lu, expected %lu",
9090
info->shm_rss, shm_rss);
9191
} else {
92-
tst_res(TPASS, "shm_rss = %li", shm_rss);
92+
tst_res(TPASS, "shm_rss = %lu", shm_rss);
9393
}
9494

9595
if (info->shm_swp != shm_swp) {
96-
tst_res(TFAIL, "shm_swp = %li, expected %li",
96+
tst_res(TFAIL, "shm_swp = %lu, expected %lu",
9797
info->shm_swp, shm_swp);
9898
} else {
99-
tst_res(TPASS, "shm_swp = %li", shm_swp);
99+
tst_res(TPASS, "shm_swp = %lu", shm_swp);
100100
}
101101

102102
if (info->shm_tot != shm_tot) {
103-
tst_res(TFAIL, "shm_tot = %li, expected %li",
103+
tst_res(TFAIL, "shm_tot = %lu, expected %lu",
104104
info->shm_tot, shm_tot);
105105
} else {
106-
tst_res(TPASS, "shm_tot = %li", shm_tot);
106+
tst_res(TPASS, "shm_tot = %lu", shm_tot);
107107
}
108108

109109
SAFE_FCLOSE(f);

0 commit comments

Comments
 (0)