All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y
@ 2013-08-22  0:34 Fabio Estevam
  2013-08-22 12:37 ` Kevin Hilman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2013-08-22  0:34 UTC (permalink / raw)
  To: linus.walleij; +Cc: vinod.koul, khilman, linux-kernel, Fabio Estevam

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

When CONFIG_ARM_LPAE=y the following build warning are generated:

drivers/dma/ste_dma40.c:3228:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
drivers/dma/ste_dma40.c:3593:5: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]

According to Documentation/printk-formats.txt '%pa' can be used to properly 
print 'resource_size_t'.

Also, for printing memory region the '%pr' is more convenient.

Reported-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/dma/ste_dma40.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 0036756..044abe4 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3226,8 +3226,8 @@ static struct d40_base * __init d40_hw_detect_init(struct platform_device *pdev)
 	num_log_chans = num_phy_chans * D40_MAX_LOG_CHAN_PER_PHY;
 
 	dev_info(&pdev->dev,
-		 "hardware rev: %d @ 0x%x with %d physical and %d logical channels\n",
-		 rev, res->start, num_phy_chans, num_log_chans);
+		 "hardware rev: %d @ %pa with %d physical and %d logical channels\n",
+		 rev, &res->start, num_phy_chans, num_log_chans);
 
 	base = kzalloc(ALIGN(sizeof(struct d40_base), 4) +
 		       (num_phy_chans + num_log_chans + num_memcpy_chans) *
@@ -3579,9 +3579,7 @@ static int __init d40_probe(struct platform_device *pdev)
 	if (request_mem_region(res->start, resource_size(res),
 			       D40_NAME " I/O lcpa") == NULL) {
 		ret = -EBUSY;
-		d40_err(&pdev->dev,
-			"Failed to request LCPA region 0x%x-0x%x\n",
-			res->start, res->end);
+		d40_err(&pdev->dev, "Failed to request LCPA region %pR\n", res);
 		goto failure;
 	}
 
@@ -3589,8 +3587,8 @@ static int __init d40_probe(struct platform_device *pdev)
 	val = readl(base->virtbase + D40_DREG_LCPA);
 	if (res->start != val && val != 0) {
 		dev_warn(&pdev->dev,
-			 "[%s] Mismatch LCPA dma 0x%x, def 0x%x\n",
-			 __func__, val, res->start);
+			 "[%s] Mismatch LCPA dma 0x%x, def %pa\n",
+			 __func__, val, &res->start);
 	} else
 		writel(res->start, base->virtbase + D40_DREG_LCPA);
 
-- 
1.8.1.2


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

* Re: [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y
  2013-08-22  0:34 [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y Fabio Estevam
@ 2013-08-22 12:37 ` Kevin Hilman
  2013-08-23 18:03 ` Linus Walleij
  2013-08-25 10:47 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Hilman @ 2013-08-22 12:37 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linus.walleij, vinod.koul, linux-kernel, Fabio Estevam

Fabio Estevam <festevam@gmail.com> writes:

> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> When CONFIG_ARM_LPAE=y the following build warning are generated:
>
> drivers/dma/ste_dma40.c:3228:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3593:5: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
>
> According to Documentation/printk-formats.txt '%pa' can be used to properly 
> print 'resource_size_t'.
>
> Also, for printing memory region the '%pr' is more convenient.
>
> Reported-by: Kevin Hilman <khilman@linaro.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Kevin Hilman <khilman@linaro.org>

And I verified the compile problem is gone away with arm_v7_defconfig +
CONFIG_ARM_LPAE=y

Thanks for the fix!

Kevin

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

* Re: [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y
  2013-08-22  0:34 [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y Fabio Estevam
  2013-08-22 12:37 ` Kevin Hilman
@ 2013-08-23 18:03 ` Linus Walleij
  2013-08-25 10:47 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2013-08-23 18:03 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Vinod Koul, Kevin Hilman, linux-kernel, Fabio Estevam

On Thu, Aug 22, 2013 at 2:34 AM, Fabio Estevam <festevam@gmail.com> wrote:

> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> When CONFIG_ARM_LPAE=y the following build warning are generated:
>
> drivers/dma/ste_dma40.c:3228:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3593:5: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
>
> According to Documentation/printk-formats.txt '%pa' can be used to properly
> print 'resource_size_t'.
>
> Also, for printing memory region the '%pr' is more convenient.
>
> Reported-by: Kevin Hilman <khilman@linaro.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Elegant!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Vinod, can you apply this?

Yours,
Linus Walleij

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

* Re: [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y
  2013-08-22  0:34 [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y Fabio Estevam
  2013-08-22 12:37 ` Kevin Hilman
  2013-08-23 18:03 ` Linus Walleij
@ 2013-08-25 10:47 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2013-08-25 10:47 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: linus.walleij, khilman, linux-kernel, Fabio Estevam

On Wed, Aug 21, 2013 at 09:34:02PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> When CONFIG_ARM_LPAE=y the following build warning are generated:
> 
> drivers/dma/ste_dma40.c:3228:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3582:3: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
> drivers/dma/ste_dma40.c:3593:5: warning: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t' [-Wformat]
> 
> According to Documentation/printk-formats.txt '%pa' can be used to properly 
> print 'resource_size_t'.
> 
> Also, for printing memory region the '%pr' is more convenient.
Applied, Thanks

~Vinod

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

end of thread, other threads:[~2013-08-25 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-22  0:34 [PATCH] dma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y Fabio Estevam
2013-08-22 12:37 ` Kevin Hilman
2013-08-23 18:03 ` Linus Walleij
2013-08-25 10:47 ` Vinod Koul

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.