coreboot/src
Paul Menzel 85ac0675ed cpu/x86/smm: Fix size_t type mismatch in print statement
The 64-bit compiler x86_64-linux-gnu-gcc-10 aborts the build with the
format warning below:

        CC         ramstage/cpu/x86/smm/smm_module_loader.o
    src/cpu/x86/smm/smm_module_loader.c: In function 'smm_module_setup_stub':
    src/cpu/x86/smm/smm_module_loader.c:360:70: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format=]
      360 |   printk(BIOS_ERR, "%s: state save size: %zx : smm_entry_offset -> %lx\n",
          |                                                                    ~~^
          |                                                                      |
          |                                                                      long unsigned int
          |                                                                    %x

As `size_t` is defined as `long unsigned int` in i386-elf (32-bit), the
length modifier `l` matches there. With x86_64-elf/x86_64-linux-gnu
(64-bit) and `-m32` `size_t` is defined as `unsigned int` resulting in a
type mismatch. So, use the correct length modifier `z` for the type
`size_t`.

Found-by: x86_64-linux-gnu-gcc-10 (Debian 10.2.1-6) 10.2.1 20210110
Fixes: afb7a814 ("cpu/x86/smm: Introduce SMM module loader version 2")
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Change-Id: I4172e0f4dc40437250da89b7720a5c1e5fbab709
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54342
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-05-30 20:19:49 +00:00
..
acpi acpi: add SRAT Generic Initiator Affinity structure 2021-05-27 14:37:19 +00:00
arch arch/x86/acpi_bert_storage: change return type of bert_errors_present 2021-05-30 20:16:12 +00:00
commonlib commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
console src: Retype option API to use unsigned integers 2021-05-06 14:48:15 +00:00
cpu cpu/x86/smm: Fix size_t type mismatch in print statement 2021-05-30 20:19:49 +00:00
device device: Consider fw_config probing in is_dev_enabled() 2021-05-24 16:55:39 +00:00
drivers Apply more uses for Kconfig TPM 2021-05-30 20:14:47 +00:00
ec ec/kontron/kempld: Guard macro parameters 2021-05-28 10:05:15 +00:00
include option: Turn CMOS option backend into choice 2021-05-28 11:37:16 +00:00
lib cbmem: Introduce "early" init hooks for console 2021-05-27 23:30:42 +00:00
mainboard mb/intel/adlrvp_m: add ec device entry to devicetree 2021-05-30 20:18:42 +00:00
northbridge nb/intel/x4x/rcven.c: Guard macro parameters 2021-05-28 10:05:37 +00:00
security Apply more uses for Kconfig TPM 2021-05-30 20:14:47 +00:00
soc soc/intel/alderlake: Add placeholder SPD file 2021-05-30 20:18:22 +00:00
southbridge sb/intel/lynxpoint: Add pch_iobp_exec() function 2021-05-20 16:04:05 +00:00
superio src: Retype option API to use unsigned integers 2021-05-06 14:48:15 +00:00
vendorcode vendorcode/intel/fsp: Update to include post PRQ UPDs for Tiger Lake 2021-05-28 18:25:26 +00:00
Kconfig option: Allow mainboards to implement the API 2021-05-28 11:37:25 +00:00