From 0594bf87c1a0f2cd99c6b02a11e6dbe2bdff3545 Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Tue, 9 Nov 2021 21:54:21 +0100 Subject: [PATCH] soc/intel/common: irq: Use correct size_t length modifier Building an image for the Purism Mini v2 with `x86_64-linux-gnu-gcc-11` fails with the format warning below as the size of size_t differs between 32-bit and 64-bit. CC ramstage/soc/intel/common/block/irq/irq.o src/soc/intel/common/block/irq/irq.c: In function 'assign_fixed_pirqs': src/soc/intel/common/block/irq/irq.c:186:90: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t' {aka 'unsigned int'} [-Werror=format=] 186 | printk(BIOS_ERR, "ERROR: Slot %u, pirq %u, no pin for function %lu\n", | ~~^ | | | long unsigned int | %u 187 | constraints->slot, fixed_pirq, i); | ~ | | | size_t {aka unsigned int} CC ramstage/soc/intel/common/block/gspi/gspi.o CC ramstage/soc/intel/common/block/graphics/graphics.o CC ramstage/soc/intel/common/block/gpio/gpio.o CC ramstage/soc/intel/common/block/gpio/gpio_dev.o The variable `i` is of type size_t, so use the corresponding length modifier `z`. Fixes: b59980b54e ("soc/intel/common: Add new IRQ module") Change-Id: I09f4a8d22a2964471344f5dcf971dfa801555f4a Signed-off-by: Paul Menzel Reviewed-on: https://review.coreboot.org/c/coreboot/+/59056 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/soc/intel/common/block/irq/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/intel/common/block/irq/irq.c b/src/soc/intel/common/block/irq/irq.c index 00aff627a8..c913c5a4f1 100644 --- a/src/soc/intel/common/block/irq/irq.c +++ b/src/soc/intel/common/block/irq/irq.c @@ -183,7 +183,7 @@ static bool assign_fixed_pirqs(const struct slot_irq_constraints *constraints, fixed pin */ const enum pci_pin pin = fn_pin_map[i]; if (pin == PCI_INT_NONE) { - printk(BIOS_ERR, "ERROR: Slot %u, pirq %u, no pin for function %lu\n", + printk(BIOS_ERR, "ERROR: Slot %u, pirq %u, no pin for function %zu\n", constraints->slot, fixed_pirq, i); return false; }