]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tools/bootconfig: Fix the wrong format specifier
authorLuo Yifan <luoyifan@cmss.chinamobile.com>
Tue, 28 Jan 2025 14:27:01 +0000 (23:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:46:56 +0000 (12:46 +0100)
[ Upstream commit f6ab7384d554ba80ff4793259d75535874b366f5 ]

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

Link: https://lore.kernel.org/all/20241105011048.201629-1-luoyifan@cmss.chinamobile.com/
Fixes: 973780011106 ("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>
tools/bootconfig/main.c

index 6cd6080cac04cf44517476b0378ddb500f39bd92..365c022fb7cdd4581eeebc094819e7bba94a43ca 100644 (file)
@@ -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;
        }
 
@@ -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();