* [PATCH] of: add 'const' to of_node_full_name parameter
@ 2012-12-18 10:32 Steffen Trumtrar
[not found] ` <1355826723-27763-1-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Steffen Trumtrar @ 2012-12-18 10:32 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ; +Cc: Steffen Trumtrar, Rob Herring
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-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] of: add 'const' to of_node_full_name parameter
[not found] ` <1355826723-27763-1-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-12-19 13:13 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2012-12-19 13:13 UTC (permalink / raw)
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ; +Cc: Steffen Trumtrar, Rob Herring
On Tue, 18 Dec 2012 11:32:03 +0100, Steffen Trumtrar <s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> 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-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Applied, thanks. Will show up in linux-next after the v3.8 merge window closes.
g.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-19 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 10:32 [PATCH] of: add 'const' to of_node_full_name parameter Steffen Trumtrar
[not found] ` <1355826723-27763-1-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-12-19 13:13 ` Grant Likely
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).