diff mbox series

tools/bootconfig: Fix the wrong format specifier

Message ID 20241105011048.201629-1-luoyifan@cmss.chinamobile.com (mailing list archive)
State New
Delegated to: Masami Hiramatsu
Headers show
Series tools/bootconfig: Fix the wrong format specifier | expand

Commit Message

Luo Yifan Nov. 5, 2024, 1:10 a.m. UTC
Use '%u' instead of '%d' for unsigned int.

Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
---
 tools/bootconfig/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Masami Hiramatsu (Google) Nov. 19, 2024, 1:25 a.m. UTC | #1
Hi Luo,

On Tue,  5 Nov 2024 09:10:48 +0800
Luo Yifan <luoyifan@cmss.chinamobile.com> wrote:

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

Good catch, thanks for the fix!
Let me pick.

> 
> Signed-off-by: Luo Yifan <luoyifan@cmss.chinamobile.com>
> ---
>  tools/bootconfig/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
> index 156b62a16..8a48cc253 100644
> --- a/tools/bootconfig/main.c
> +++ b/tools/bootconfig/main.c
> @@ -226,7 +226,7 @@ static int load_xbc_from_initrd(int fd, char **buf)
>  	/* Wrong Checksum */
>  	rcsum = xbc_calc_checksum(*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;
>  	}
>  
> @@ -395,7 +395,7 @@ static int apply_xbc(const char *path, const char *xbc_path)
>  	xbc_get_info(&ret, NULL);
>  	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_exit();
> -- 
> 2.27.0
> 
> 
>
diff mbox series

Patch

diff --git a/tools/bootconfig/main.c b/tools/bootconfig/main.c
index 156b62a16..8a48cc253 100644
--- a/tools/bootconfig/main.c
+++ b/tools/bootconfig/main.c
@@ -226,7 +226,7 @@  static int load_xbc_from_initrd(int fd, char **buf)
 	/* Wrong Checksum */
 	rcsum = xbc_calc_checksum(*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;
 	}
 
@@ -395,7 +395,7 @@  static int apply_xbc(const char *path, const char *xbc_path)
 	xbc_get_info(&ret, NULL);
 	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_exit();