linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
@ 2014-04-29  3:24 Fabio Estevam
  2014-04-29  5:35 ` Jingoo Han
  2014-04-29  5:45 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2014-04-29  3:24 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: bhelgaas, linux-pci, jg1.han, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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 v1:
- use the [mem 0x - 0x] notation

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

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index e384e25..df57a6a 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -330,8 +330,8 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
 							sz, remap);
 		if (ret) {
 			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, &base + sz, ret);
 			mvebu_pcie_del_windows(port, base - size_mapped,
 					       size_mapped);
 			return;
-- 
1.8.3.2


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

* Re: [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
  2014-04-29  3:24 [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type Fabio Estevam
@ 2014-04-29  5:35 ` Jingoo Han
  2014-04-29  5:45 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2014-04-29  5:35 UTC (permalink / raw)
  To: 'Fabio Estevam'
  Cc: 'Thomas Petazzoni', 'Bjorn Helgaas', linux-pci,
	'Fabio Estevam', 'Jingoo Han'

On Tuesday, April 29, 2014 12:25 PM, Fabio Estevam wrote:
> 
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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>

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
> Changes since v1:
> - use the [mem 0x - 0x] notation
> 
>  drivers/pci/host/pci-mvebu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> index e384e25..df57a6a 100644
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -330,8 +330,8 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
>  							sz, remap);
>  		if (ret) {
>  			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, &base + sz, ret);
>  			mvebu_pcie_del_windows(port, base - size_mapped,
>  					       size_mapped);
>  			return;
> --
> 1.8.3.2


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

* Re: [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
  2014-04-29  3:24 [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type Fabio Estevam
  2014-04-29  5:35 ` Jingoo Han
@ 2014-04-29  5:45 ` Thomas Petazzoni
  2014-04-29  5:53   ` Jingoo Han
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2014-04-29  5:45 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: bhelgaas, linux-pci, jg1.han, Fabio Estevam

Dear Fabio Estevam,

On Tue, 29 Apr 2014 00:24:56 -0300, Fabio Estevam wrote:

>  		if (ret) {
>  			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, &base + sz, ret);

Are you sure '&base + sz' works here? %pa needs a reference as
argument, so &base looks good. But '&base + sz' means you will print
the value which is at the address of base, to which 'sz' is added,
which is not what we want here. Probably you need something like:

	phys_addr_t end = base + sz;

and then use '&end'.

Or I am missing something?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type
  2014-04-29  5:45 ` Thomas Petazzoni
@ 2014-04-29  5:53   ` Jingoo Han
  0 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2014-04-29  5:53 UTC (permalink / raw)
  To: 'Thomas Petazzoni', 'Fabio Estevam'
  Cc: 'Fabio Estevam', bhelgaas, linux-pci,
	'Jingoo Han'

On Tuesday, April 29, 2014 2:46 PM, Thomas Petazzoni wrote:
> On Tue, 29 Apr 2014 00:24:56 -0300, Fabio Estevam wrote:
> 
> >  		if (ret) {
> >  			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, &base + sz, ret);
> 
> Are you sure '&base + sz' works here? %pa needs a reference as
> argument, so &base looks good. But '&base + sz' means you will print
> the value which is at the address of base, to which 'sz' is added,
> which is not what we want here. Probably you need something like:
> 
> 	phys_addr_t end = base + sz;
> 
> and then use '&end'.
> 
> Or I am missing something?

I agree with your suggestion.
Thanks.

Best regards,
Jingoo Han

> 
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com


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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-29  3:24 [PATCH v2] pci: pci-mvebu: Use '%pa' for printing 'phys_addr_t' type Fabio Estevam
2014-04-29  5:35 ` Jingoo Han
2014-04-29  5:45 ` Thomas Petazzoni
2014-04-29  5:53   ` Jingoo Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).