All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] habanalabs: use %pad for printing a dma_addr_t
@ 2019-07-08 12:39 Arnd Bergmann
  2019-07-09  6:07 ` Oded Gabbay
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-07-08 12:39 UTC (permalink / raw)
  To: Oded Gabbay, Arnd Bergmann, Greg Kroah-Hartman
  Cc: Tomer Tayar, Mike Rapoport, Omer Shpigelman, Dalit Ben Zoor,
	linux-kernel

dma_addr_t might be different sizes depending on the configuration,
so we cannot print it as %llx:

drivers/misc/habanalabs/goya/goya.c: In function 'goya_sw_init':
drivers/misc/habanalabs/goya/goya.c:698:21: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]

Use the special %pad format string. This requires passing the
argument by reference.

Fixes: 2a51558c8c7f ("habanalabs: remove DMA mask hack for Goya")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/misc/habanalabs/goya/goya.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 75294ec65257..60e509f64051 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -695,8 +695,8 @@ static int goya_sw_init(struct hl_device *hdev)
 		goto free_dma_pool;
 	}
 
-	dev_dbg(hdev->dev, "cpu accessible memory at bus address 0x%llx\n",
-		hdev->cpu_accessible_dma_address);
+	dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n",
+		&hdev->cpu_accessible_dma_address);
 
 	hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1);
 	if (!hdev->cpu_accessible_dma_pool) {
-- 
2.20.0


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

* Re: [PATCH] habanalabs: use %pad for printing a dma_addr_t
  2019-07-08 12:39 [PATCH] habanalabs: use %pad for printing a dma_addr_t Arnd Bergmann
@ 2019-07-09  6:07 ` Oded Gabbay
  2019-07-09  6:08   ` Oded Gabbay
  0 siblings, 1 reply; 3+ messages in thread
From: Oded Gabbay @ 2019-07-09  6:07 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg Kroah-Hartman, Tomer Tayar, Mike Rapoport, Omer Shpigelman,
	Linux-Kernel@Vger. Kernel. Org

On Mon, Jul 8, 2019 at 3:39 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> dma_addr_t might be different sizes depending on the configuration,
> so we cannot print it as %llx:
>
> drivers/misc/habanalabs/goya/goya.c: In function 'goya_sw_init':
> drivers/misc/habanalabs/goya/goya.c:698:21: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
>
> Use the special %pad format string. This requires passing the
> argument by reference.
>
> Fixes: 2a51558c8c7f ("habanalabs: remove DMA mask hack for Goya")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/misc/habanalabs/goya/goya.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
> index 75294ec65257..60e509f64051 100644
> --- a/drivers/misc/habanalabs/goya/goya.c
> +++ b/drivers/misc/habanalabs/goya/goya.c
> @@ -695,8 +695,8 @@ static int goya_sw_init(struct hl_device *hdev)
>                 goto free_dma_pool;
>         }
>
> -       dev_dbg(hdev->dev, "cpu accessible memory at bus address 0x%llx\n",
> -               hdev->cpu_accessible_dma_address);
> +       dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n",
> +               &hdev->cpu_accessible_dma_address);
>
>         hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1);
>         if (!hdev->cpu_accessible_dma_pool) {
> --
> 2.20.0
>

This patch is:
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>

Thanks! applied to -next

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

* Re: [PATCH] habanalabs: use %pad for printing a dma_addr_t
  2019-07-09  6:07 ` Oded Gabbay
@ 2019-07-09  6:08   ` Oded Gabbay
  0 siblings, 0 replies; 3+ messages in thread
From: Oded Gabbay @ 2019-07-09  6:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg Kroah-Hartman, Tomer Tayar, Mike Rapoport, Omer Shpigelman,
	Linux-Kernel@Vger. Kernel. Org

On Tue, Jul 9, 2019 at 9:07 AM Oded Gabbay <oded.gabbay@gmail.com> wrote:
>
> On Mon, Jul 8, 2019 at 3:39 PM Arnd Bergmann <arnd@arndb.de> wrote:
> >
> > dma_addr_t might be different sizes depending on the configuration,
> > so we cannot print it as %llx:
> >
> > drivers/misc/habanalabs/goya/goya.c: In function 'goya_sw_init':
> > drivers/misc/habanalabs/goya/goya.c:698:21: error: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'dma_addr_t' {aka 'unsigned int'} [-Werror=format=]
> >
> > Use the special %pad format string. This requires passing the
> > argument by reference.
> >
> > Fixes: 2a51558c8c7f ("habanalabs: remove DMA mask hack for Goya")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/misc/habanalabs/goya/goya.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
> > index 75294ec65257..60e509f64051 100644
> > --- a/drivers/misc/habanalabs/goya/goya.c
> > +++ b/drivers/misc/habanalabs/goya/goya.c
> > @@ -695,8 +695,8 @@ static int goya_sw_init(struct hl_device *hdev)
> >                 goto free_dma_pool;
> >         }
> >
> > -       dev_dbg(hdev->dev, "cpu accessible memory at bus address 0x%llx\n",
> > -               hdev->cpu_accessible_dma_address);
> > +       dev_dbg(hdev->dev, "cpu accessible memory at bus address %pad\n",
> > +               &hdev->cpu_accessible_dma_address);
> >
> >         hdev->cpu_accessible_dma_pool = gen_pool_create(ilog2(32), -1);
> >         if (!hdev->cpu_accessible_dma_pool) {
> > --
> > 2.20.0
> >
>
> This patch is:
> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
>
> Thanks! applied to -next
Sorry, meant -fixes of course.

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

end of thread, other threads:[~2019-07-09  6:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-08 12:39 [PATCH] habanalabs: use %pad for printing a dma_addr_t Arnd Bergmann
2019-07-09  6:07 ` Oded Gabbay
2019-07-09  6:08   ` Oded Gabbay

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.