NTB: ntb_perf: fix printing of resource_size_t
PATCH 1/1 NTB: ntb_perf: fix printing of resource_size_t
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.
--- drivers/ntb/test/ntb_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ntb/test/ntb_perf.c +2 -2
@@ -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 ;
Signature · 1 line
2.9.0
Quoted 9 lines · Arnd Bergmann
On 32-bit architectures,
resource_size_tis 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
Quoted 25 lines
Fixes b83003b3fdc1 ("NTB: ntb_perf: Add full multi-port NTB API support")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/ntb/test/ntb_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/ntb/test/ntb_perf.c +2
-2@@ -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 ;Signature · 1 line
2.9.0