Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: add 'const' to of_node_full_name parameter

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@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Steffen Trumtrar and committed by
Grant Likely
c0a05bf0 ced4eec9

+1 -1
+1 -1
include/linux/of.h
··· 160 160 161 161 #define OF_BAD_ADDR ((u64)-1) 162 162 163 - static inline const char* of_node_full_name(struct device_node *np) 163 + static inline const char *of_node_full_name(const struct device_node *np) 164 164 { 165 165 return np ? np->full_name : "<no-node>"; 166 166 }