devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: dma: Fix-up for warnings !CONFIG_OF
@ 2012-11-29 22:24 Jon Hunter
  2012-11-29 23:47 ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Hunter @ 2012-11-29 22:24 UTC (permalink / raw)
  To: Vinod Koul
  Cc: device-tree, linux-omap, linux-arm, Rob Herring, Grant Likely,
	Fengguang Wu, Jon Hunter

When compiling the kernel with DMA engine support enabled and device-tree
support disabled, the following warnings are observed.

In file included from drivers/dma/dmaengine.c:65:0:
include/linux/of_dma.h: In function 'of_dma_controller_free':
include/linux/of_dma.h:57:1: warning: no return statement in function
	returning non-void [-Wreturn-type]
drivers/dma/dmaengine.c: At top level:
include/linux/of_dma.h:47:12: warning: 'of_dma_controller_register'
	defined but not used [-Wunused-function]
include/linux/of_dma.h:55:12: warning: 'of_dma_controller_free' defined
	but not used [-Wunused-function]
include/linux/of_dma.h:65:25: warning: 'of_dma_simple_xlate' defined
	but not used [-Wunused-function]

Fix-up the warnings by adding a return value for the
of_dma_controller_free() stub and make all the stubs static inline to
avoid the unused warnings.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
 include/linux/of_dma.h |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h
index 84b64f8..b14a34f 100644
--- a/include/linux/of_dma.h
+++ b/include/linux/of_dma.h
@@ -44,7 +44,7 @@ extern struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
 extern struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
 		struct of_dma *ofdma);
 #else
-static int of_dma_controller_register(struct device_node *np,
+static inline int of_dma_controller_register(struct device_node *np,
 		struct dma_chan *(*of_dma_xlate)
 		(struct of_phandle_args *, struct of_dma *),
 		void *data)
@@ -52,18 +52,19 @@ static int of_dma_controller_register(struct device_node *np,
 	return -ENODEV;
 }
 
-static int of_dma_controller_free(struct device_node *np)
+static inline int of_dma_controller_free(struct device_node *np)
 {
+	return 0;
 }
 
-static struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
-						     char *name)
+static inline struct dma_chan *of_dma_request_slave_channel(
+		struct device_node *np, char *name)
 {
 	return NULL;
 }
 
-static struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
-		struct of_dma *ofdma)
+static inline struct dma_chan *of_dma_simple_xlate(
+		struct of_phandle_args *dma_spec, struct of_dma *ofdma)
 {
 	return NULL;
 }
-- 
1.7.10.4


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

end of thread, other threads:[~2012-11-30 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-29 22:24 [PATCH] of: dma: Fix-up for warnings !CONFIG_OF Jon Hunter
2012-11-29 23:47 ` Vinod Koul
2012-11-30 15:36   ` Jon Hunter

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