Skip to contentSkip to conversation

Add forward declaration of struct device

PATCH In review Rolf Eike Beer 2 participants 3 messages Dec 20, 2010 – Jan 19, 2011 MM misc

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add forward declaration of struct device

This fixes this warning when including linux/dmapool.h first:

warning: ‘struct device’ declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want

---
 include/linux/dmapool.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/dmapool.h +2 -0
index 022e34f..52456aa 100644
@@ -14,6 +14,8 @@
 #include <asm/io.h>
 #include <asm/scatterlist.h>
 
+struct device;
+
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
 			size_t size, size_t align, size_t allocation);
 
Signature · 1 line
1.6.4.2
#1 lore raw
Quoted 4 lines · Rolf Eike Beer

This fixes this warning when including linux/dmapool.h first:

warning: ‘struct device’ declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want

In what situation do you see this warning? (the one you have posted doesn't show the filename that is being compiled).

Quoted 19 lines
---
 include/linux/dmapool.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/dmapool.h +2 -0
index 022e34f..52456aa 100644
@@ -14,6 +14,8 @@
 #include <asm/io.h>
 #include <asm/scatterlist.h>
 
+struct device;
+
 struct dma_pool *dma_pool_create(const char *name, struct device *dev, 
 			size_t size, size_t align, size_t allocation);
 
Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#2 lore raw

Am Mittwoch 19 Januar 2011, 15:56:47 schrieb Jiri Kosina:

Quoted 9 lines · Rolf Eike Beer
Quoted 5 lines

This fixes this warning when including linux/dmapool.h first:

warning: ‘struct device’ declared inside parameter list
warning: its scope is only this definition or declaration, which is probably not what you want

In what situation do you see this warning? (the one you have posted doesn't show the filename that is being compiled).

Nothing (yet) in tree.

Eike