From: Guenter Roeck <linux@roeck-us.net>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] soc: qcom: cmd-db: Cast sizeof() to int to silence field width warning
Date: Fri, 17 Apr 2020 06:56:24 -0700 [thread overview]
Message-ID: <20200417135624.GA88652@roeck-us.net> (raw)
In-Reply-To: <20200415062033.66406-1-swboyd@chromium.org>
On Tue, Apr 14, 2020 at 11:20:33PM -0700, Stephen Boyd wrote:
> 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=]
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/soc/qcom/cmd-db.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
> index 6c308f92a13c..6b5c440c9dc3 100644
> --- a/drivers/soc/qcom/cmd-db.c
> +++ b/drivers/soc/qcom/cmd-db.c
> @@ -280,7 +280,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) {
prev parent reply other threads:[~2020-04-17 13:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 6:20 Stephen Boyd
2020-04-15 6:28 ` Stephen Boyd
2020-04-17 13:56 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200417135624.GA88652@roeck-us.net \
--to=linux@roeck-us.net \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=swboyd@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®