[PATCH] of: add 'const' to of_node_full_name parameter

Steffen Trumtrar s.trumtrar at pengutronix.de
Tue Dec 18 21:32:03 EST 2012


As the function just returns the np->full_name or the string "<no-node>", the
passed device_node pointer is not changed in any way.

The passed parameter can therefore be a const pointer.

Also, fix the following error from checkpatch.pl:

ERROR: "foo* bar" should be "foo *bar"
+static inline const char* of_node_full_name(const struct device_node *np)

Signed-off-by: Steffen Trumtrar <s.trumtrar at pengutronix.de>
---
 include/linux/of.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index b4e50d5..f525390 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -159,7 +159,7 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
 
 #define OF_BAD_ADDR	((u64)-1)
 
-static inline const char* of_node_full_name(struct device_node *np)
+static inline const char *of_node_full_name(const struct device_node *np)
 {
 	return np ? np->full_name : "<no-node>";
 }
-- 
1.7.10.4



More information about the devicetree-discuss mailing list