soc/intel/xeon_sp: 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         romstage/soc/intel/xeon_sp/memmap.o
    src/soc/intel/xeon_sp/memmap.c: In function 'fill_postcar_frame':
    src/soc/intel/xeon_sp/memmap.c:39:62: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
       39 |         printk(BIOS_DEBUG, "cbmem base_ptr: 0x%lx, size: 0x%lx\n", cbmem_base, cbmem_size);
          |                                                            ~~^                 ~~~~~~~~~~
          |                                                              |                 |
          |                                                              long unsigned int size_t {aka unsigned int}
          |                                                            %x

As `cbmem_size` is of type `size_t` use the appropriate length modifier
`z`.

Change-Id: I1ca77de1ce33ce1e97d7c8895c6e75424f0769f5
Found-by: gcc (Debian 11.2.0-10) 11.2.0
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59054
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Lance Zhao
This commit is contained in:
Paul Menzel 2021-11-09 08:24:26 +01:00 committed by Paul Fagerburg
parent d1598991a3
commit a1aca1e656
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ void fill_postcar_frame(struct postcar_frame *pcf)
/* Try account for the CBMEM region currently used and for future use */ /* Try account for the CBMEM region currently used and for future use */
cbmem_get_region((void **)&cbmem_base, &cbmem_size); cbmem_get_region((void **)&cbmem_base, &cbmem_size);
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram); printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
printk(BIOS_DEBUG, "cbmem base_ptr: 0x%lx, size: 0x%lx\n", cbmem_base, cbmem_size); printk(BIOS_DEBUG, "cbmem base_ptr: 0x%lx, size: 0x%zx\n", cbmem_base, cbmem_size);
/* Assume 4MiB will be enough for future cbmem objects (FSP-S, ramstage, ...) */ /* Assume 4MiB will be enough for future cbmem objects (FSP-S, ramstage, ...) */
cbmem_base -= 4 * MiB; cbmem_base -= 4 * MiB;
cbmem_base = ALIGN_DOWN(cbmem_base, 4 * MiB); cbmem_base = ALIGN_DOWN(cbmem_base, 4 * MiB);