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>
This commit is contained in:
Elyes Haouas 2022-06-15 15:36:03 +02:00 committed by Arthur Heymans
parent 15d99c718d
commit 1f07797d84
1 changed files with 4 additions and 4 deletions

View File

@ -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));
}