Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357954 > unrolled thread

[PATCH] bus: mvebu-mbus: use %pad to print phys_addr_t

Started byArnd Bergmann <arnd@arndb.de>
First post2016-03-15 11:10 +0100
Last post2016-03-15 11:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] bus: mvebu-mbus: use %pad to print phys_addr_t Arnd Bergmann <arnd@arndb.de> - 2016-03-15 11:10 +0100
    Re: [PATCH] bus: mvebu-mbus: use %pad to print phys_addr_t Joe Perches <joe@perches.com> - 2016-03-15 11:10 +0100

#1357954 — [PATCH] bus: mvebu-mbus: use %pad to print phys_addr_t

FromArnd Bergmann <arnd@arndb.de>
Date2016-03-15 11:10 +0100
Subject[PATCH] bus: mvebu-mbus: use %pad to print phys_addr_t
Message-ID<rcU5k-Bl-5@gated-at.bofh.it>
A recent change to the mbus driver added a warning printk that
prints a phys_addr_t using the %x format string, which fails in
case we build with 64-bit phys_addr_t:

drivers/bus/mvebu-mbus.c: In function 'mvebu_mbus_get_dram_win_info':
drivers/bus/mvebu-mbus.c:975:9: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'phys_addr_t {aka long long unsigned int}' [-Werror=format=]

This uses the special %pa format string instead, so we always
print the correct type.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: f2900acea801 ("bus: mvebu-mbus: provide api for obtaining IO and DRAM window information")
---
The warning was introduced in today's linux-next through the net-next
tree, please apply this fixup on top.

 drivers/bus/mvebu-mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index c2e52864bb03..ce54a0160faa 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -972,7 +972,7 @@ int mvebu_mbus_get_dram_win_info(phys_addr_t phyaddr, u8 *target, u8 *attr)
 		}
 	}
 
-	pr_err("invalid dram address 0x%x\n", phyaddr);
+	pr_err("invalid dram address %pa\n", &phyaddr);
 	return -EINVAL;
 }
 EXPORT_SYMBOL_GPL(mvebu_mbus_get_dram_win_info);
-- 
2.7.0

[toc] | [next] | [standalone]


#1357955

FromJoe Perches <joe@perches.com>
Date2016-03-15 11:10 +0100
Message-ID<rcU5l-Bl-9@gated-at.bofh.it>
In reply to#1357954
On Tue, 2016-03-15 at 11:03 +0100, Arnd Bergmann wrote:
> A recent change to the mbus driver added a warning printk that
> prints a phys_addr_t using the %x format string, which fails in
> case we build with 64-bit phys_addr_t:

Hey Arnd.

This is a bad patch subject, %pad is for a dma_addr_t.
The patch subject made me assume the patch was incorrect.

> > This uses the special %pa format string instead, so we always
> print the correct type.
[]
> -	pr_err("invalid dram address 0x%x\n", phyaddr);
> +	pr_err("invalid dram address %pa\n", &phyaddr);

The patch is good though.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web