From: Geoff Levand <geoff-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Grant Likely
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] of: Fix constantness of of_n_size_cells
Date: Fri, 22 Aug 2014 17:43:36 +0000 [thread overview]
Message-ID: <cover.1408729200.git.geoff@infradead.org> (raw)
The of_n_size_cells() routine only does a read-only operation on the device tree
passed in, so add the const keyword to that argument so that of_n_size_cells()
can be called with read-only data without casting.
Signed-off-by: Geoff Levand <geoff-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
---
The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:
Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)
are available in the git repository at:
git://git.linaro.org/people/geoff.levand/linux-kexec.git for-of
for you to fetch changes up to e7667576c053daedba1da0b14d4476bc25a86a11:
of: Fix constantness of of_n_size_cells (2014-08-22 10:33:59 -0700)
----------------------------------------------------------------
Geoff Levand (1):
of: Fix constantness of of_n_size_cells
drivers/of/base.c | 4 ++--
include/linux/of.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index d8574ad..f773679 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -53,7 +53,7 @@ DEFINE_MUTEX(of_mutex);
*/
DEFINE_RAW_SPINLOCK(devtree_lock);
-int of_n_addr_cells(struct device_node *np)
+int of_n_addr_cells(const struct device_node *np)
{
const __be32 *ip;
@@ -69,7 +69,7 @@ int of_n_addr_cells(struct device_node *np)
}
EXPORT_SYMBOL(of_n_addr_cells);
-int of_n_size_cells(struct device_node *np)
+int of_n_size_cells(const struct device_node *np)
{
const __be32 *ip;
diff --git a/include/linux/of.h b/include/linux/of.h
index 6c4363b..6eebcf6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -285,8 +285,8 @@ extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
#define for_each_property_of_node(dn, pp) \
for (pp = dn->properties; pp != NULL; pp = pp->next)
-extern int of_n_addr_cells(struct device_node *np);
-extern int of_n_size_cells(struct device_node *np);
+extern int of_n_addr_cells(const struct device_node *np);
+extern int of_n_size_cells(const struct device_node *np);
extern const struct of_device_id *of_match_node(
const struct of_device_id *matches, const struct device_node *node);
extern int of_modalias_node(struct device_node *node, char *modalias, int len);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2014-08-22 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 17:43 Geoff Levand [this message]
[not found] ` <cover.1408729200.git.geoff-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-08-27 10:28 ` [PATCH] of: Fix constantness of of_n_size_cells Grant Likely
[not found] ` <20140827102827.50E15C409CB-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-08-29 19:26 ` Geoff Levand
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=cover.1408729200.git.geoff@infradead.org \
--to=geoff-wegcikhe2lqwvfeawa7xhq@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/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).