From: Stephen Boyd Date: Wed, 15 Apr 2020 06:20:33 +0000 (-0700) Subject: soc: qcom: cmd-db: Cast sizeof() to int to silence field width warning X-Git-Tag: v5.8-rc1~138^2~15^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d6ba921acf43bf1894564eb3d51ced2145e0147;p=thirdparty%2Fkernel%2Flinux.git soc: qcom: cmd-db: Cast sizeof() to int to silence field width warning We pass the result of sizeof() here to tell the printk format specifier how many bytes to print. That expects an int though and sizeof() isn't that type. Cast to int to silence this warning: drivers/soc/qcom/cmd-db.c: In function 'cmd_db_debugfs_dump': drivers/soc/qcom/cmd-db.c:281:30: warning: field width specifier '*' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=] Reviewed-by: Guenter Roeck Fixes: d6815c5c43d4 ("soc: qcom: cmd-db: Add debugfs dumping file") Reported-by: Stephen Rothwell Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20200415062033.66406-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson --- diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c index 8b2b7357b6da9..57382b64f1dae 100644 --- a/drivers/soc/qcom/cmd-db.c +++ b/drivers/soc/qcom/cmd-db.c @@ -279,7 +279,7 @@ static int cmd_db_debugfs_dump(struct seq_file *seq, void *p) ent = rsc_to_entry_header(rsc); for (j = 0; j < le16_to_cpu(rsc->cnt); j++, ent++) { seq_printf(seq, "0x%08x: %*pEp", le32_to_cpu(ent->addr), - sizeof(ent->id), ent->id); + (int)sizeof(ent->id), ent->id); len = le16_to_cpu(ent->len); if (len) {