From caf121d3730d11a08f66f9b16f7e53c4d21737d3 Mon Sep 17 00:00:00 2001 From: offsoc <139764790+offsoc@users.noreply.github.com> Date: Tue, 24 Sep 2024 00:47:47 +0800 Subject: [PATCH] Fix code scanning alert #12: Wrong type of arguments to formatting function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- arch/x86/boot/tools/build.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c index 10311d77c67f8f..f3ef59aa2cc9b6 100644 --- a/arch/x86/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c @@ -34,6 +34,7 @@ #include #include #include +#include #include typedef unsigned char u8; @@ -215,8 +216,8 @@ int main(int argc, char ** argv) if (fstat(fd, &sb)) die("Unable to stat `%s': %m", argv[2]); if (_edata != sb.st_size) - die("Unexpected file size `%s': %u != %u", argv[2], _edata, - sb.st_size); + die("Unexpected file size `%s': %lu != %lu", argv[2], (unsigned long)_edata, + (unsigned long)sb.st_size); sz = _edata - 4; kernel = mmap(NULL, sz, PROT_READ, MAP_SHARED, fd, 0); if (kernel == MAP_FAILED)