summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-06-15 15:36:03 +0200
committerArthur Heymans <arthur@aheymans.xyz>2022-06-15 16:12:29 +0000
commit1f07797d849cd86dea3a81f79454821b7217032f (patch)
tree203cb95a84b70e312f5b21cec611debf6255d643
parent15d99c718d55aeeb8ea4f4b469c61ee3125e117c (diff)
cpu/x86/smm/smm_module_loader.c: Fix formatted print
This fixes following errors when building GA-945GCM-S2L with clang 14.0.5. CC ramstage/cpu/x86/smm/smm_module_loader.o src/cpu/x86/smm/smm_module_loader.c:180:10: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] region_offset(&cpus[i].stub_code), i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/cpu/x86/smm/smm_module_loader.c:184:20: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] __func__, region_offset(&cpus[0].stub_code), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/cpu/x86/smm/smm_module_loader.c:185:10: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] region_offset(&cpus[i].stub_code), size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/cpu/x86/smm/smm_module_loader.c:349:52: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] printk(BIOS_DEBUG, "%-12s [0x%lx-0x%lx]\n", name, region_offset(&region), ~~~ ^~~~~~~~~~~~~~~~~~~~~~ %zx src/cpu/x86/smm/smm_module_loader.c:350:9: error: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat] region_end(&region)); Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I59f20aacf91cb50fb194a84082a643b34c6c1ae5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65154 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/cpu/x86/smm/smm_module_loader.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cpu/x86/smm/smm_module_loader.c b/src/cpu/x86/smm/smm_module_loader.c
index c3de3f3329..768d2ca1bb 100644
--- a/src/cpu/x86/smm/smm_module_loader.c
+++ b/src/cpu/x86/smm/smm_module_loader.c
@@ -170,17 +170,17 @@ u32 smm_get_cpu_smbase(unsigned int cpu_num)
static void smm_place_entry_code(const unsigned int num_cpus)
{
unsigned int i;
- unsigned int size;
+ size_t size;
/* start at 1, the first CPU stub code is already there */
size = region_sz(&cpus[0].stub_code);
for (i = 1; i < num_cpus; i++) {
printk(BIOS_DEBUG,
- "SMM Module: placing smm entry code at %lx, cpu # 0x%x\n",
+ "SMM Module: placing smm entry code at %zx, cpu # 0x%x\n",
region_offset(&cpus[i].stub_code), i);
memcpy((void *)region_offset(&cpus[i].stub_code),
(void *)region_offset(&cpus[0].stub_code), size);
- printk(BIOS_SPEW, "%s: copying from %lx to %lx 0x%x bytes\n",
+ printk(BIOS_SPEW, "%s: copying from %zx to %zx 0x%zx bytes\n",
__func__, region_offset(&cpus[0].stub_code),
region_offset(&cpus[i].stub_code), size);
}
@@ -346,7 +346,7 @@ static void setup_smihandler_params(struct smm_runtime *mod_params,
static void print_region(const char *name, const struct region region)
{
- printk(BIOS_DEBUG, "%-12s [0x%lx-0x%lx]\n", name, region_offset(&region),
+ printk(BIOS_DEBUG, "%-12s [0x%zx-0x%zx]\n", name, region_offset(&region),
region_end(&region));
}