linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata: fsl: fix DPRINTK format string
@ 2021-05-14 21:33 Arnd Bergmann
  2021-05-17 15:12 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-05-14 21:33 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Arnd Bergmann, linux-ide, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Printing an __iomem pointer as %x produces a warning:

drivers/ata/sata_fsl.c: In function 'fsl_sata_set_irq_coalescing':
drivers/ata/sata_fsl.c:316:17: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'void *' [-Werror=format=]
  316 |         DPRINTK("ICC register status: (hcr base: 0x%x) = 0x%x\n",
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317 |                         hcr_base, ioread32(hcr_base + ICC));
      |                         ~~~~~~~~
      |                         |
      |                         void *

It's not clear why that pointer should be printed here, but if we do,
then using %p is the way to avoid the warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/ata/sata_fsl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index d55ee244d693..e5838b23c9e0 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -313,7 +313,7 @@ static void fsl_sata_set_irq_coalescing(struct ata_host *host,
 
 	DPRINTK("interrupt coalescing, count = 0x%x, ticks = %x\n",
 			intr_coalescing_count, intr_coalescing_ticks);
-	DPRINTK("ICC register status: (hcr base: 0x%x) = 0x%x\n",
+	DPRINTK("ICC register status: (hcr base: %p) = 0x%x\n",
 			hcr_base, ioread32(hcr_base + ICC));
 }
 
-- 
2.29.2


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

* Re: [PATCH] sata: fsl: fix DPRINTK format string
  2021-05-14 21:33 [PATCH] sata: fsl: fix DPRINTK format string Arnd Bergmann
@ 2021-05-17 15:12 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-05-17 15:12 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Arnd Bergmann, linux-ide, linux-kernel

On 5/14/21 3:33 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Printing an __iomem pointer as %x produces a warning:
> 
> drivers/ata/sata_fsl.c: In function 'fsl_sata_set_irq_coalescing':
> drivers/ata/sata_fsl.c:316:17: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'void *' [-Werror=format=]
>   316 |         DPRINTK("ICC register status: (hcr base: 0x%x) = 0x%x\n",
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   317 |                         hcr_base, ioread32(hcr_base + ICC));
>       |                         ~~~~~~~~
>       |                         |
>       |                         void *
> 
> It's not clear why that pointer should be printed here, but if we do,
> then using %p is the way to avoid the warnings.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-05-17 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 21:33 [PATCH] sata: fsl: fix DPRINTK format string Arnd Bergmann
2021-05-17 15:12 ` Jens Axboe

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).