All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
@ 2014-04-29 12:58 Fabio Estevam
  2014-04-29 16:54 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2014-04-29 12:58 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: bhelgaas, linux-pci, jg1.han, Fabio Estevam

Fix the following build warning that happens when building multi_v7_defconfig
with CONFIG_ARM_LPAE=y:

drivers/pci/host/pci-mvebu.c:334:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'phys_addr_t' [-Wformat=]

Fix the warning by using '%pa' to printing 'phys_addr_t' type. While at it,
also use the more standard notation [mem 0x - 0x] for memory region.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Introduce variable 'end' for printing the memory range

Changes since v1:
- use the [mem 0x - 0x] notation

 drivers/pci/host/pci-mvebu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index e384e25..8329592 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -329,9 +329,11 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
 		ret = mvebu_mbus_add_window_remap_by_id(target, attribute, base,
 							sz, remap);
 		if (ret) {
+			phys_addr_t end = base + sz;
+
 			dev_err(&port->pcie->pdev->dev,
-				"Could not create MBus window at 0x%x, size 0x%x: %d\n",
-				base, sz, ret);
+				"Could not create MBus window at [mem %pa - %pa] :%d\n",
+				&base, &end, ret);
 			mvebu_pcie_del_windows(port, base - size_mapped,
 					       size_mapped);
 			return;
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
  2014-04-29 12:58 [PATCH v3] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type Fabio Estevam
@ 2014-04-29 16:54 ` Bjorn Helgaas
  2014-04-29 16:57   ` Jason Cooper
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2014-04-29 16:54 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: thomas.petazzoni, linux-pci, jg1.han, Jason Cooper

[+cc Jason]

On Tue, Apr 29, 2014 at 09:58:07AM -0300, Fabio Estevam wrote:
> Fix the following build warning that happens when building multi_v7_defconfig
> with CONFIG_ARM_LPAE=y:
> 
> drivers/pci/host/pci-mvebu.c:334:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'phys_addr_t' [-Wformat=]
> 
> Fix the warning by using '%pa' to printing 'phys_addr_t' type. While at it,
> also use the more standard notation [mem 0x - 0x] for memory region.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v2:
> - Introduce variable 'end' for printing the memory range
> 
> Changes since v1:
> - use the [mem 0x - 0x] notation
> 
>  drivers/pci/host/pci-mvebu.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index e384e25..8329592 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -329,9 +329,11 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
>  		ret = mvebu_mbus_add_window_remap_by_id(target, attribute, base,
>  							sz, remap);
>  		if (ret) {
> +			phys_addr_t end = base + sz;

This needs to be "base + sz - 1" because we print inclusive ranges.

> +
>  			dev_err(&port->pcie->pdev->dev,
> -				"Could not create MBus window at 0x%x, size 0x%x: %d\n",
> -				base, sz, ret);
> +				"Could not create MBus window at [mem %pa - %pa] :%d\n",

I removed the extra spaces (relative to %pR) here.

> +				&base, &end, ret);
>  			mvebu_pcie_del_windows(port, base - size_mapped,
>  					       size_mapped);
>  			return;


I'm ready to merge the following, given an ack from Thomas or Jason.
Jingoo, I added your reviewed-by, since this is essentially what you
reviewed before.

Bjorn


commit 5bbf2f268b9001c2e46aff6ff17cee0e8a6b8fb8
Author: Fabio Estevam <fabio.estevam@freescale.com>
Date:   Tue Apr 29 09:58:07 2014 -0300

    PCI: mvebu: Use '%pa' for printing 'phys_addr_t' type
    
    Fix the following build warning that happens when building
    multi_v7_defconfig with CONFIG_ARM_LPAE=y:
    
      drivers/pci/host/pci-mvebu.c:334:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'phys_addr_t' [-Wformat=]
    
    Fix the warning by using '%pa' to printing 'phys_addr_t' type.  While at
    it, also use the more standard notation [mem 0x-0x] for memory region.
    
    Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Jingoo Han <jg1.han@samsung.com>

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 29d64c9efa85..7f450322f397 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -328,9 +328,11 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
 		ret = mvebu_mbus_add_window_remap_by_id(target, attribute, base,
 							sz, remap);
 		if (ret) {
+			phys_addr_t end = base + sz - 1;
+
 			dev_err(&port->pcie->pdev->dev,
-				"Could not create MBus window at 0x%x, size 0x%x: %d\n",
-				base, sz, ret);
+				"Could not create MBus window at [mem %pa-%pa]: %d\n",
+				&base, &end, ret);
 			mvebu_pcie_del_windows(port, base - size_mapped,
 					       size_mapped);
 			return;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
  2014-04-29 16:54 ` Bjorn Helgaas
@ 2014-04-29 16:57   ` Jason Cooper
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Cooper @ 2014-04-29 16:57 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Fabio Estevam, thomas.petazzoni, linux-pci, jg1.han

On Tue, Apr 29, 2014 at 10:54:19AM -0600, Bjorn Helgaas wrote:
...
> I'm ready to merge the following, given an ack from Thomas or Jason.
> Jingoo, I added your reviewed-by, since this is essentially what you
> reviewed before.
> 
> Bjorn
> 
> 
> commit 5bbf2f268b9001c2e46aff6ff17cee0e8a6b8fb8
> Author: Fabio Estevam <fabio.estevam@freescale.com>
> Date:   Tue Apr 29 09:58:07 2014 -0300
> 
>     PCI: mvebu: Use '%pa' for printing 'phys_addr_t' type
>     
>     Fix the following build warning that happens when building
>     multi_v7_defconfig with CONFIG_ARM_LPAE=y:
>     
>       drivers/pci/host/pci-mvebu.c:334:5: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'phys_addr_t' [-Wformat=]
>     
>     Fix the warning by using '%pa' to printing 'phys_addr_t' type.  While at
>     it, also use the more standard notation [mem 0x-0x] for memory region.
>     
>     Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>     Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-29 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29 12:58 [PATCH v3] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type Fabio Estevam
2014-04-29 16:54 ` Bjorn Helgaas
2014-04-29 16:57   ` Jason Cooper

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.