[PATCH] broadcom: Fix an compile warning in nvram_init

From: zhong jiang
Date: Mon Sep 23 2019 - 02:22:17 EST


I hit the following error when compile the kernel.

drivers/firmware/broadcom/bcm47xx_nvram.c: In function ânvram_initâ:
./include/linux/kern_levels.h:5:18: warning: format â%zuâ expects argument of type âsize_tâ, but argument 2 has type âu32 {aka unsigned int}â [-Wformat=]
#define KERN_SOH "\001" /* ASCII Start Of Header */
^
./include/linux/kern_levels.h:11:18: note: in expansion of macro âKERN_SOHâ
#define KERN_ERR KERN_SOH "3" /* error conditions */
^~~~~~~~
./include/linux/printk.h:304:9: note: in expansion of macro âKERN_ERRâ
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~
drivers/firmware/broadcom/bcm47xx_nvram.c:151:4: note: in expansion of macro âpr_errâ
pr_err("nvram on flash (%zu bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n",
^~~~~~
CC sound/soc/sof/debug.o
drivers/firmware/broadcom/bcm47xx_nvram.c:151:30: note: format string is defined here
pr_err("nvram on flash (%zu bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n",

Signed-off-by: zhong jiang <zhongjiang@xxxxxxxxxx>
---
drivers/firmware/broadcom/bcm47xx_nvram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/broadcom/bcm47xx_nvram.c b/drivers/firmware/broadcom/bcm47xx_nvram.c
index 6d2820f..75a3240 100644
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
@@ -148,7 +148,7 @@ static int nvram_init(void)
header.len > sizeof(header)) {
nvram_len = header.len;
if (nvram_len >= NVRAM_SPACE) {
- pr_err("nvram on flash (%zu bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n",
+ pr_err("nvram on flash (%u bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n",
header.len, NVRAM_SPACE);
nvram_len = NVRAM_SPACE - 1;
}
--
1.7.12.4