Skip to content

Commit

Permalink
safe_mmap(): Fix compiler warning in tst_res() format
Browse files Browse the repository at this point in the history
The length variable has type size_t so the appropriate format is %zu.

Link: https://lore.kernel.org/ltp/20240507155225.14126-1-mdoucha@suse.cz/
Fixes: ff5f945 ("Print prot flag when SAFE_MMAP() fails")
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
  • Loading branch information
mdoucha authored and pevik committed May 7, 2024
1 parent 7841eed commit 67f1550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/tst_safe_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ static inline void *safe_mmap(const char *file, const int lineno,
tst_prot_to_str(prot, prot_buf);

tst_res_(file, lineno, TDEBUG,
"mmap(%p, %ld, %s(%x), %d, %d, %ld)",
"mmap(%p, %zu, %s(%x), %d, %d, %ld)",
addr, length, prot_buf, prot, flags, fd, offset);

rval = mmap(addr, length, prot, flags, fd, offset);
Expand Down

0 comments on commit 67f1550

Please sign in to comment.