Skip to content

Commit

Permalink
tools/bootconfig: Fix the wrong format specifier
Browse files Browse the repository at this point in the history
[ Upstream commit f6ab738 ]

Use '%u' instead of '%d' for unsigned int.

Link: https://lore.kernel.org/all/20241105011048.201629-1-luoyifan@cmss.chinamobile.com/

Fixes: 9737800 ("tools/bootconfig: Suppress non-error messages")
Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Luo Yifan authored and Greg Kroah-Hartman committed Mar 13, 2025
1 parent fc22131 commit 3ac4439
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/bootconfig/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int load_xbc_from_initrd(int fd, char **buf)
/* Wrong Checksum */
rcsum = checksum((unsigned char *)*buf, size);
if (csum != rcsum) {
pr_err("checksum error: %d != %d\n", csum, rcsum);
pr_err("checksum error: %u != %u\n", csum, rcsum);
return -EINVAL;
}

Expand Down Expand Up @@ -375,7 +375,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
printf("Apply %s to %s\n", xbc_path, path);
printf("\tNumber of nodes: %d\n", ret);
printf("\tSize: %u bytes\n", (unsigned int)size);
printf("\tChecksum: %d\n", (unsigned int)csum);
printf("\tChecksum: %u\n", (unsigned int)csum);

/* TODO: Check the options by schema */
xbc_destroy_all();
Expand Down

0 comments on commit 3ac4439

Please sign in to comment.