Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59055 )
Change subject: drivers/ipmi: Fix type mismatch in print statements ......................................................................
drivers/ipmi: Fix type mismatch in print statements
The size of char * differs between 32-bit and 64-bit.
Fix the mismatches in `read_fru_chassis_info_area()`.
CC ramstage/drivers/ipmi/ipmi_fru.o src/drivers/ipmi/ipmi_fru.c: In function 'read_fru_chassis_info_area': src/drivers/ipmi/ipmi_fru.c:192:57: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Werror=format=] 192 | printk(BIOS_ERR, "%s failed to malloc %ld bytes for " | ~~^ | | | long int | %d 193 | "chassis custom data array.\n", __func__, 194 | info->custom_count * sizeof(char *)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int src/drivers/ipmi/ipmi_fru.c: In function 'read_fru_board_info_area': src/drivers/ipmi/ipmi_fru.c:291:57: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Werror=format=] 291 | printk(BIOS_ERR, "%s failed to malloc %ld bytes for " | ~~^ | | | long int | %d 292 | "board custom data array.\n", __func__, 293 | info->custom_count * sizeof(char *)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int src/drivers/ipmi/ipmi_fru.c: In function 'read_fru_product_info_area': src/drivers/ipmi/ipmi_fru.c:398:57: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Werror=format=] 398 | printk(BIOS_ERR, "%s failed to malloc %ld bytes for " | ~~^ | | | long int | %d 399 | "product custom data array.\n", __func__, 400 | info->custom_count * sizeof(char *)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | unsigned int
Change-Id: If0c4266b19d56fa88abc397f305154d473ae1a93 Found-by: gcc (Debian 11.2.0-10) 11.2.0 Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/drivers/ipmi/ipmi_fru.c 1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/59055/1
diff --git a/src/drivers/ipmi/ipmi_fru.c b/src/drivers/ipmi/ipmi_fru.c index 31ac6c0..9c4ad41 100644 --- a/src/drivers/ipmi/ipmi_fru.c +++ b/src/drivers/ipmi/ipmi_fru.c @@ -189,7 +189,7 @@
info->chassis_custom = malloc(info->custom_count * sizeof(char *)); if (!info->chassis_custom) { - printk(BIOS_ERR, "%s failed to malloc %ld bytes for " + printk(BIOS_ERR, "%s failed to malloc %d bytes for " "chassis custom data array.\n", __func__, info->custom_count * sizeof(char *)); ret = CB_ERR; @@ -288,7 +288,7 @@
info->board_custom = malloc(info->custom_count * sizeof(char *)); if (!info->board_custom) { - printk(BIOS_ERR, "%s failed to malloc %ld bytes for " + printk(BIOS_ERR, "%s failed to malloc %d bytes for " "board custom data array.\n", __func__, info->custom_count * sizeof(char *)); ret = CB_ERR; @@ -395,7 +395,7 @@
info->product_custom = malloc(info->custom_count * sizeof(char *)); if (!info->product_custom) { - printk(BIOS_ERR, "%s failed to malloc %ld bytes for " + printk(BIOS_ERR, "%s failed to malloc %d bytes for " "product custom data array.\n", __func__, info->custom_count * sizeof(char *)); ret = CB_ERR;