summaryrefslogtreecommitdiff
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-01-24 03:54:02 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 04:36:55 +0400
commit00b2c76a6abbe082bb5afb89ee49ec325e9cd4d2 (patch)
tree5592406c52b323fff71cc1ecd5bc4d24678ebd76 /include/linux/of.h
parent04f9b74e4d96d349de12fdd4e6626af4a9f75e09 (diff)
downloadlinux-00b2c76a6abbe082bb5afb89ee49ec325e9cd4d2.tar.xz
include/linux/of.h: make for_each_child_of_node() reference its args when CONFIG_OF=n
Make for_each_child_of_node() reference its args when CONFIG_OF=n to avoid warnings like: drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node' [-Wunused-variable] struct device_node *node = pdev->dev.of_node; ^ Signed-off-by: David Howells <dhowells@redhat.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <robh+dt@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 276c546980d8..70c64ba17fa5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -377,8 +377,13 @@ static inline bool of_have_populated_dt(void)
return false;
}
+/* Kill an unused variable warning on a device_node pointer */
+static inline void __of_use_dn(const struct device_node *np)
+{
+}
+
#define for_each_child_of_node(parent, child) \
- while (0)
+ while (__of_use_dn(parent), __of_use_dn(child), 0)
#define for_each_available_child_of_node(parent, child) \
while (0)