From: "Andrew Jeffery" <andrew@aj.id.au>
To: "Arnd Bergmann" <arnd@kernel.org>,
"Stefan M Schaeckeler" <sschaeck@cisco.com>,
"Borislav Petkov" <bp@alien8.de>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Tony Luck" <tony.luck@intel.com>,
"Joel Stanley" <joel@jms.id.au>,
"Troy Lee" <troy_lee@aspeedtech.com>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
"James Morse" <james.morse@arm.com>,
"Robert Richter" <rric@kernel.org>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Liu Shixin" <liushixin2@huawei.com>,
linux-edac@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EDAC/aspeed: use proper format string for printing resource
Date: Tue, 27 Apr 2021 11:52:41 +0930 [thread overview]
Message-ID: <dd4286c6-c856-40c4-b1f8-060f76258d57@www.fastmail.com> (raw)
In-Reply-To: <20210421135500.3518661-1-arnd@kernel.org>
On Wed, 21 Apr 2021, at 23:24, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> On ARMv7, resource_size_t can be 64-bit, which breaks printing
> it as %x:
>
> drivers/edac/aspeed_edac.c: In function 'init_csrows':
> drivers/edac/aspeed_edac.c:257:28: error: format '%x' expects argument
> of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka
> 'long long unsigned int'} [-Werror=format=]
> 257 | dev_dbg(mci->pdev, "dt: /memory node resources: first
> page r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
>
> Use the special %pR format string to pretty-print the entire
> resource instead.
>
> Fixes: edfc2d73ca45 ("EDAC/aspeed: Add support for AST2400 and AST2600")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/edac/aspeed_edac.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> index a46da56d6d54..6bd5f8815919 100644
> --- a/drivers/edac/aspeed_edac.c
> +++ b/drivers/edac/aspeed_edac.c
> @@ -254,8 +254,8 @@ static int init_csrows(struct mem_ctl_info *mci)
> return rc;
> }
>
> - dev_dbg(mci->pdev, "dt: /memory node resources: first page
> r.start=0x%x, resource_size=0x%x, PAGE_SHIFT macro=0x%x\n",
> - r.start, resource_size(&r), PAGE_SHIFT);
> + dev_dbg(mci->pdev, "dt: /memory node resources: first page %pR, PAGE_SHIFT macro=0x%x\n",
Could probably drop the "first page " as well, but it's a dev_dbg() and not a big deal.
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
next prev parent reply other threads:[~2021-04-27 2:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 13:54 [PATCH] EDAC/aspeed: use proper format string for printing resource Arnd Bergmann
2021-04-27 2:22 ` Andrew Jeffery [this message]
2021-05-18 14:51 ` Borislav Petkov
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=dd4286c6-c856-40c4-b1f8-060f76258d57@www.fastmail.com \
--to=andrew@aj.id.au \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bp@alien8.de \
--cc=james.morse@arm.com \
--cc=joel@jms.id.au \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushixin2@huawei.com \
--cc=mchehab@kernel.org \
--cc=rric@kernel.org \
--cc=sschaeck@cisco.com \
--cc=tony.luck@intel.com \
--cc=troy_lee@aspeedtech.com \
/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