* [PATCH] NTB: ntb_perf: fix printing of resource_size_t
@ 2018-01-19 14:55 Arnd Bergmann
2018-01-19 15:43 ` Jon Mason
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-01-19 14:55 UTC (permalink / raw)
To: Jon Mason, Dave Jiang, Allen Hubbe
Cc: Arnd Bergmann, Gary R Hook, Serge Semin, linux-ntb, linux-kernel
On 32-bit architectures, resource_size_t is usually 'unsigned int' or
'unsigned long' but not 'unsigned long long', so we get a warning
about printing the wrong data:
drivers/ntb/test/ntb_perf.c: In function 'perf_setup_peer_mw':
drivers/ntb/test/ntb_perf.c:1390:35: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t {aka unsigned int}' [-Werror=format=]
This changes the format string to the special %pa that is already
used elsewhere in the same file.
Fixes: b83003b3fdc1 ("NTB: ntb_perf: Add full multi-port NTB API support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/ntb/test/ntb_perf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 8de72f3fba4d..1829a17dd461 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -1387,8 +1387,8 @@ static int perf_setup_peer_mw(struct perf_peer *peer)
if (max_mw_size && peer->outbuf_size > max_mw_size) {
peer->outbuf_size = max_mw_size;
dev_warn(&peer->perf->ntb->dev,
- "Peer %d outbuf reduced to %#llx\n", peer->pidx,
- peer->outbuf_size);
+ "Peer %d outbuf reduced to %pa\n", peer->pidx,
+ &peer->outbuf_size);
}
return 0;
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NTB: ntb_perf: fix printing of resource_size_t
2018-01-19 14:55 [PATCH] NTB: ntb_perf: fix printing of resource_size_t Arnd Bergmann
@ 2018-01-19 15:43 ` Jon Mason
0 siblings, 0 replies; 2+ messages in thread
From: Jon Mason @ 2018-01-19 15:43 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dave Jiang, Allen Hubbe, Gary R Hook, Serge Semin, linux-ntb,
linux-kernel
On Fri, Jan 19, 2018 at 03:55:28PM +0100, Arnd Bergmann wrote:
> On 32-bit architectures, resource_size_t is usually 'unsigned int' or
> 'unsigned long' but not 'unsigned long long', so we get a warning
> about printing the wrong data:
>
> drivers/ntb/test/ntb_perf.c: In function 'perf_setup_peer_mw':
> drivers/ntb/test/ntb_perf.c:1390:35: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t {aka unsigned int}' [-Werror=format=]
>
> This changes the format string to the special %pa that is already
> used elsewhere in the same file.
Applied to my ntb-next branch.
Thanks,
Jon
>
> Fixes: b83003b3fdc1 ("NTB: ntb_perf: Add full multi-port NTB API support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/ntb/test/ntb_perf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index 8de72f3fba4d..1829a17dd461 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -1387,8 +1387,8 @@ static int perf_setup_peer_mw(struct perf_peer *peer)
> if (max_mw_size && peer->outbuf_size > max_mw_size) {
> peer->outbuf_size = max_mw_size;
> dev_warn(&peer->perf->ntb->dev,
> - "Peer %d outbuf reduced to %#llx\n", peer->pidx,
> - peer->outbuf_size);
> + "Peer %d outbuf reduced to %pa\n", peer->pidx,
> + &peer->outbuf_size);
> }
>
> return 0;
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-19 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-19 14:55 [PATCH] NTB: ntb_perf: fix printing of resource_size_t Arnd Bergmann
2018-01-19 15:43 ` Jon Mason
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.