devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jon-hunter@ti.com>
To: Vinod Koul <vinod.koul@linux.intel.com>
Cc: device-tree <devicetree-discuss@lists.ozlabs.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-arm <linux-arm-kernel@lists.infradead.org>,
	Rob Herring <robherring2@gmail.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Fengguang Wu <fengguang.wu@intel.com>,
	Jon Hunter <jon-hunter@ti.com>
Subject: [PATCH] of: dma: Fix-up for warnings !CONFIG_OF
Date: Thu, 29 Nov 2012 16:24:27 -0600	[thread overview]
Message-ID: <1354227867-13357-1-git-send-email-jon-hunter@ti.com> (raw)

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


             reply	other threads:[~2012-11-29 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 22:24 Jon Hunter [this message]
2012-11-29 23:47 ` [PATCH] of: dma: Fix-up for warnings !CONFIG_OF Vinod Koul
2012-11-30 15:36   ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354227867-13357-1-git-send-email-jon-hunter@ti.com \
    --to=jon-hunter@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=fengguang.wu@intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robherring2@gmail.com \
    --cc=vinod.koul@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).