All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma: vdma: Fix compilation warnings
@ 2015-03-30  9:00 ` Kedareswara rao Appana
  0 siblings, 0 replies; 7+ messages in thread
From: Kedareswara rao Appana @ 2015-03-30  9:00 UTC (permalink / raw)
  To: vinod.koul, sfr; +Cc: linux-next, linux-kernel, anirudh, Kedareswara rao Appana

This patch fixes the following compilation warnings.
In file included from drivers/dma/xilinx/xilinx_vdma.c:26:0:
include/linux/dmapool.h:18:4: warning: 'struct device' declared inside parameter list
    size_t size, size_t align, size_t allocation);
    ^
include/linux/dmapool.h:18:4: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/dmapool.h:31:7: warning: 'struct device' declared inside parameter list
       size_t size, size_t align, size_t allocation);
       ^
drivers/dma/xilinx/xilinx_vdma.c: In function 'xilinx_vdma_alloc_chan_resources':
drivers/dma/xilinx/xilinx_vdma.c:501:20: warning: passing argument 2 of 'dma_pool_create' from incompatible pointer type
  chan->desc_pool = dma_pool_create("xilinx_vdma_desc_pool",
                    ^
In file included from drivers/dma/xilinx/xilinx_vdma.c:26:0:
include/linux/dmapool.h:17:18: note: expected 'struct device *' but argument is of type 'struct device *'
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, .

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
- This patch is rebased on the slave-dma next.

 include/linux/dmapool.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index 022e34f..01c91bb 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -13,6 +13,7 @@
 
 #include <asm/io.h>
 #include <asm/scatterlist.h>
+#include <linux/device.h>
 
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
 			size_t size, size_t align, size_t allocation);
-- 
2.1.2


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

* [PATCH] dma: vdma: Fix compilation warnings
@ 2015-03-30  9:00 ` Kedareswara rao Appana
  0 siblings, 0 replies; 7+ messages in thread
From: Kedareswara rao Appana @ 2015-03-30  9:00 UTC (permalink / raw)
  To: vinod.koul, sfr; +Cc: linux-next, linux-kernel, anirudh, Kedareswara rao Appana

This patch fixes the following compilation warnings.
In file included from drivers/dma/xilinx/xilinx_vdma.c:26:0:
include/linux/dmapool.h:18:4: warning: 'struct device' declared inside parameter list
    size_t size, size_t align, size_t allocation);
    ^
include/linux/dmapool.h:18:4: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/dmapool.h:31:7: warning: 'struct device' declared inside parameter list
       size_t size, size_t align, size_t allocation);
       ^
drivers/dma/xilinx/xilinx_vdma.c: In function 'xilinx_vdma_alloc_chan_resources':
drivers/dma/xilinx/xilinx_vdma.c:501:20: warning: passing argument 2 of 'dma_pool_create' from incompatible pointer type
  chan->desc_pool = dma_pool_create("xilinx_vdma_desc_pool",
                    ^
In file included from drivers/dma/xilinx/xilinx_vdma.c:26:0:
include/linux/dmapool.h:17:18: note: expected 'struct device *' but argument is of type 'struct device *'
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, .

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
- This patch is rebased on the slave-dma next.

 include/linux/dmapool.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
index 022e34f..01c91bb 100644
--- a/include/linux/dmapool.h
+++ b/include/linux/dmapool.h
@@ -13,6 +13,7 @@
 
 #include <asm/io.h>
 #include <asm/scatterlist.h>
+#include <linux/device.h>
 
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
 			size_t size, size_t align, size_t allocation);
-- 
2.1.2

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

* Re: [PATCH] dma: vdma: Fix compilation warnings
  2015-03-30  9:00 ` Kedareswara rao Appana
@ 2015-03-30  9:36   ` Stephen Rothwell
  -1 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2015-03-30  9:36 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: vinod.koul, linux-next, linux-kernel, anirudh, Kedareswara rao Appana

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

Hi Kedareswara,

On Mon, 30 Mar 2015 14:30:26 +0530 Kedareswara rao Appana <appana.durga.rao@xilinx.com> wrote:
>
> diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
> index 022e34f..01c91bb 100644
> --- a/include/linux/dmapool.h
> +++ b/include/linux/dmapool.h
> @@ -13,6 +13,7 @@
>  
>  #include <asm/io.h>
>  #include <asm/scatterlist.h>
> +#include <linux/device.h>
>  
>  struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
>  			size_t size, size_t align, size_t allocation);

This might be to much, all it really needs is a

struct device;

line ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] dma: vdma: Fix compilation warnings
@ 2015-03-30  9:36   ` Stephen Rothwell
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen Rothwell @ 2015-03-30  9:36 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: vinod.koul, linux-next, linux-kernel, anirudh, Kedareswara rao Appana

[-- Attachment #1: Type: text/plain, Size: 686 bytes --]

Hi Kedareswara,

On Mon, 30 Mar 2015 14:30:26 +0530 Kedareswara rao Appana <appana.durga.rao@xilinx.com> wrote:
>
> diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
> index 022e34f..01c91bb 100644
> --- a/include/linux/dmapool.h
> +++ b/include/linux/dmapool.h
> @@ -13,6 +13,7 @@
>  
>  #include <asm/io.h>
>  #include <asm/scatterlist.h>
> +#include <linux/device.h>
>  
>  struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
>  			size_t size, size_t align, size_t allocation);

This might be to much, all it really needs is a

struct device;

line ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH] dma: vdma: Fix compilation warnings
  2015-03-30  9:36   ` Stephen Rothwell
  (?)
@ 2015-03-30 11:40   ` Appana Durga Kedareswara Rao
  2015-03-30 13:10     ` Stephen Rothwell
  -1 siblings, 1 reply; 7+ messages in thread
From: Appana Durga Kedareswara Rao @ 2015-03-30 11:40 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: vinod.koul, linux-next, linux-kernel, Anirudha Sarangi

Hi Stephen Rothwell,

> -----Original Message-----
> From: Stephen Rothwell [mailto:sfr@canb.auug.org.au]
> Sent: Monday, March 30, 2015 3:06 PM
> To: Appana Durga Kedareswara Rao
> Cc: vinod.koul@intel.com; linux-next@vger.kernel.org; linux-
> kernel@vger.kernel.org; Anirudha Sarangi; Appana Durga Kedareswara Rao
> Subject: Re: [PATCH] dma: vdma: Fix compilation warnings
>
> Hi Kedareswara,
>
> On Mon, 30 Mar 2015 14:30:26 +0530 Kedareswara rao Appana
> <appana.durga.rao@xilinx.com> wrote:
> >
> > diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index
> > 022e34f..01c91bb 100644
> > --- a/include/linux/dmapool.h
> > +++ b/include/linux/dmapool.h
> > @@ -13,6 +13,7 @@
> >
> >  #include <asm/io.h>
> >  #include <asm/scatterlist.h>
> > +#include <linux/device.h>
> >
> >  struct dma_pool *dma_pool_create(const char *name, struct device *dev,
> >                     size_t size, size_t align, size_t allocation);
>
> This might be to much, all it really needs is a
>
> struct device;
>
> line ...

Why it is a better solution rather than including header file?
I didn't get you could you please explain a bit.

Regards,
Kedar.

>
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


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

* Re: [PATCH] dma: vdma: Fix compilation warnings
  2015-03-30 11:40   ` Appana Durga Kedareswara Rao
@ 2015-03-30 13:10     ` Stephen Rothwell
  2015-03-30 13:18       ` Appana Durga Kedareswara Rao
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Rothwell @ 2015-03-30 13:10 UTC (permalink / raw)
  To: Appana Durga Kedareswara Rao
  Cc: vinod.koul, linux-next, linux-kernel, Anirudha Sarangi

[-- Attachment #1: Type: text/plain, Size: 1798 bytes --]

Hi Appana,

On Mon, 30 Mar 2015 11:40:02 +0000 Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com> wrote:
>
> > -----Original Message-----
> > From: Stephen Rothwell [mailto:sfr@canb.auug.org.au]
> > Sent: Monday, March 30, 2015 3:06 PM
> > To: Appana Durga Kedareswara Rao
> > Cc: vinod.koul@intel.com; linux-next@vger.kernel.org; linux-
> > kernel@vger.kernel.org; Anirudha Sarangi; Appana Durga Kedareswara Rao
> > Subject: Re: [PATCH] dma: vdma: Fix compilation warnings
> >
> > Hi Kedareswara,
> >
> > On Mon, 30 Mar 2015 14:30:26 +0530 Kedareswara rao Appana
> > <appana.durga.rao@xilinx.com> wrote:
> > >
> > > diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index
> > > 022e34f..01c91bb 100644
> > > --- a/include/linux/dmapool.h
> > > +++ b/include/linux/dmapool.h
> > > @@ -13,6 +13,7 @@
> > >
> > >  #include <asm/io.h>
> > >  #include <asm/scatterlist.h>
> > > +#include <linux/device.h>
> > >
> > >  struct dma_pool *dma_pool_create(const char *name, struct device *dev,
> > >                     size_t size, size_t align, size_t allocation);
> >
> > This might be to much, all it really needs is a
> >
> > struct device;
> >
> > line ...
> 
> Why it is a better solution rather than including header file?
> I didn't get you could you please explain a bit.

When adding an include to an include file, there is always the chance
that you may create a circular include and break some other unrelated
code.  In this case the far more unintrusive fix is to just add the
forward declaration of the struct to satisfy the compiler as the actual
definition of the struct is not needed (since only pointers to the
struct are referenced in dmapool.h).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH] dma: vdma: Fix compilation warnings
  2015-03-30 13:10     ` Stephen Rothwell
@ 2015-03-30 13:18       ` Appana Durga Kedareswara Rao
  0 siblings, 0 replies; 7+ messages in thread
From: Appana Durga Kedareswara Rao @ 2015-03-30 13:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: vinod.koul, linux-next, linux-kernel, Anirudha Sarangi

Hi Stephen,

> -----Original Message-----
> From: Stephen Rothwell [mailto:sfr@canb.auug.org.au]
> Sent: Monday, March 30, 2015 6:41 PM
> To: Appana Durga Kedareswara Rao
> Cc: vinod.koul@intel.com; linux-next@vger.kernel.org; linux-
> kernel@vger.kernel.org; Anirudha Sarangi
> Subject: Re: [PATCH] dma: vdma: Fix compilation warnings
>
> Hi Appana,
>
> On Mon, 30 Mar 2015 11:40:02 +0000 Appana Durga Kedareswara Rao
> <appana.durga.rao@xilinx.com> wrote:
> >
> > > -----Original Message-----
> > > From: Stephen Rothwell [mailto:sfr@canb.auug.org.au]
> > > Sent: Monday, March 30, 2015 3:06 PM
> > > To: Appana Durga Kedareswara Rao
> > > Cc: vinod.koul@intel.com; linux-next@vger.kernel.org; linux-
> > > kernel@vger.kernel.org; Anirudha Sarangi; Appana Durga Kedareswara
> > > Rao
> > > Subject: Re: [PATCH] dma: vdma: Fix compilation warnings
> > >
> > > Hi Kedareswara,
> > >
> > > On Mon, 30 Mar 2015 14:30:26 +0530 Kedareswara rao Appana
> > > <appana.durga.rao@xilinx.com> wrote:
> > > >
> > > > diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h
> > > > index 022e34f..01c91bb 100644
> > > > --- a/include/linux/dmapool.h
> > > > +++ b/include/linux/dmapool.h
> > > > @@ -13,6 +13,7 @@
> > > >
> > > >  #include <asm/io.h>
> > > >  #include <asm/scatterlist.h>
> > > > +#include <linux/device.h>
> > > >
> > > >  struct dma_pool *dma_pool_create(const char *name, struct device
> *dev,
> > > >                     size_t size, size_t align, size_t allocation);
> > >
> > > This might be to much, all it really needs is a
> > >
> > > struct device;
> > >
> > > line ...
> >
> > Why it is a better solution rather than including header file?
> > I didn't get you could you please explain a bit.
>
> When adding an include to an include file, there is always the chance that you
> may create a circular include and break some other unrelated code.  In this
> case the far more unintrusive fix is to just add the forward declaration of the
> struct to satisfy the compiler as the actual definition of the struct is not
> needed (since only pointers to the struct are referenced in dmapool.h).
>

Ok got it thanks for the clarification.

Will send a v2 with the change that you suggested.

Regards,
Kedar.

> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au


This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


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

end of thread, other threads:[~2015-03-30 13:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30  9:00 [PATCH] dma: vdma: Fix compilation warnings Kedareswara rao Appana
2015-03-30  9:00 ` Kedareswara rao Appana
2015-03-30  9:36 ` Stephen Rothwell
2015-03-30  9:36   ` Stephen Rothwell
2015-03-30 11:40   ` Appana Durga Kedareswara Rao
2015-03-30 13:10     ` Stephen Rothwell
2015-03-30 13:18       ` Appana Durga Kedareswara Rao

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.