linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types)
       [not found] <5133ae8b.eQXjkB7tQEqiUMck%fengguang.wu@intel.com>
@ 2013-03-03 20:51 ` Arnd Bergmann
  2013-03-04  4:37   ` Viresh Kumar
  2013-03-04  4:52   ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2013-03-03 20:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 03 March 2013, kbuild test robot wrote:
> >> drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types)
>    drivers/dma/dw_dmac.c:1278:48:    expected restricted __be32 const [usertype] *p
>    drivers/dma/dw_dmac.c:1278:48:    got unsigned int *
> >> drivers/dma/dw_dmac.c:1279:48: sparse: incorrect type in argument 1 (different base types)
>    drivers/dma/dw_dmac.c:1279:48:    expected restricted __be32 const [usertype] *p
>    drivers/dma/dw_dmac.c:1279:48:    got unsigned int *
> >> drivers/dma/dw_dmac.c:1280:48: sparse: incorrect type in argument 1 (different base types)
>    drivers/dma/dw_dmac.c:1280:48:    expected restricted __be32 const [usertype] *p
>    drivers/dma/dw_dmac.c:1280:48:    got unsigned int *
> 

Cool, thanks for the notification! That is a real bug, the variables
are already endian swapped at this point.

Fortunately, nothing is using that code at this moment, so we can fix
this with no hurry.

Vinod, could you apply this patch?

	Arnd

8<-------
Subject: [PATCH] dmaengine: dw_dma: fix endianess for DT xlate function

As reported by Wu Fengguang's build robot tracking sparse warnings, the
dma_spec arguments in the dw_dma_xlate are already byte swapped on
littl-endian platforms and must not get swapped again. This code is
currently not used anywhere, but will be used in Linux 3.10 when the
ARM SPEAr platform starts using the generic DMA DT binding.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index c599558..eb81ec9 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1276,9 +1276,9 @@ static struct dma_chan *dw_dma_xlate(struct of_phandle_args *dma_spec,
 	if (dma_spec->args_count != 3)
 		return NULL;
 
-	fargs.req = be32_to_cpup(dma_spec->args+0);
-	fargs.src = be32_to_cpup(dma_spec->args+1);
-	fargs.dst = be32_to_cpup(dma_spec->args+2);
+	fargs.req = dma_spec->args[0];
+	fargs.src = dma_spec->args[1];
+	fargs.dst = dma_spec->args[2];
 
 	if (WARN_ON(fargs.req >= DW_DMA_MAX_NR_REQUESTS ||
 		    fargs.src >= dw->nr_masters ||

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

* drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types)
  2013-03-03 20:51 ` drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types) Arnd Bergmann
@ 2013-03-04  4:37   ` Viresh Kumar
  2013-03-04  4:52   ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2013-03-04  4:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Mar 4, 2013 at 4:51 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> Subject: [PATCH] dmaengine: dw_dma: fix endianess for DT xlate function
>
> As reported by Wu Fengguang's build robot tracking sparse warnings, the
> dma_spec arguments in the dw_dma_xlate are already byte swapped on
> littl-endian platforms and must not get swapped again. This code is

s/littl/little

> currently not used anywhere, but will be used in Linux 3.10 when the
> ARM SPEAr platform starts using the generic DMA DT binding.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types)
  2013-03-03 20:51 ` drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types) Arnd Bergmann
  2013-03-04  4:37   ` Viresh Kumar
@ 2013-03-04  4:52   ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2013-03-04  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Mar 03, 2013 at 08:51:28PM +0000, Arnd Bergmann wrote:
> On Sunday 03 March 2013, kbuild test robot wrote:
> > >> drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types)
> >    drivers/dma/dw_dmac.c:1278:48:    expected restricted __be32 const [usertype] *p
> >    drivers/dma/dw_dmac.c:1278:48:    got unsigned int *
> > >> drivers/dma/dw_dmac.c:1279:48: sparse: incorrect type in argument 1 (different base types)
> >    drivers/dma/dw_dmac.c:1279:48:    expected restricted __be32 const [usertype] *p
> >    drivers/dma/dw_dmac.c:1279:48:    got unsigned int *
> > >> drivers/dma/dw_dmac.c:1280:48: sparse: incorrect type in argument 1 (different base types)
> >    drivers/dma/dw_dmac.c:1280:48:    expected restricted __be32 const [usertype] *p
> >    drivers/dma/dw_dmac.c:1280:48:    got unsigned int *
> > 
> 
> Cool, thanks for the notification! That is a real bug, the variables
> are already endian swapped at this point.
> 
> Fortunately, nothing is using that code at this moment, so we can fix
> this with no hurry.
> 
> Vinod, could you apply this patch?
Done, applied to fixes. Will send to Linus before I leave for vacation on Thu.
Updated change log with reported-by & typo fix
> 
> 	Arnd
> 
> 8<-------
> Subject: [PATCH] dmaengine: dw_dma: fix endianess for DT xlate function
> 
> As reported by Wu Fengguang's build robot tracking sparse warnings, the
> dma_spec arguments in the dw_dma_xlate are already byte swapped on
> littl-endian platforms and must not get swapped again. This code is
> currently not used anywhere, but will be used in Linux 3.10 when the
> ARM SPEAr platform starts using the generic DMA DT binding.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
> index c599558..eb81ec9 100644
> --- a/drivers/dma/dw_dmac.c
> +++ b/drivers/dma/dw_dmac.c
> @@ -1276,9 +1276,9 @@ static struct dma_chan *dw_dma_xlate(struct of_phandle_args *dma_spec,
>  	if (dma_spec->args_count != 3)
>  		return NULL;
>  
> -	fargs.req = be32_to_cpup(dma_spec->args+0);
> -	fargs.src = be32_to_cpup(dma_spec->args+1);
> -	fargs.dst = be32_to_cpup(dma_spec->args+2);
> +	fargs.req = dma_spec->args[0];
> +	fargs.src = dma_spec->args[1];
> +	fargs.dst = dma_spec->args[2];
>  
>  	if (WARN_ON(fargs.req >= DW_DMA_MAX_NR_REQUESTS ||
>  		    fargs.src >= dw->nr_masters ||

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

end of thread, other threads:[~2013-03-04  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5133ae8b.eQXjkB7tQEqiUMck%fengguang.wu@intel.com>
2013-03-03 20:51 ` drivers/dma/dw_dmac.c:1278:48: sparse: incorrect type in argument 1 (different base types) Arnd Bergmann
2013-03-04  4:37   ` Viresh Kumar
2013-03-04  4:52   ` Vinod Koul

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