From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: [PATCH] of: constify property name parameters for helper functions
Date: Tue, 2 Aug 2011 16:51:54 +0100 [thread overview]
Message-ID: <20110802155154.GA31611@ponder.secretlab.ca> (raw)
In-Reply-To: <1312296307-32527-1-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
On Tue, Aug 02, 2011 at 03:45:07PM +0100, Jamie Iles wrote:
> The helper functions for reading u32 integers, u32 arrays and strings
> should have the property name as a const pointer.
>
> Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> Signed-off-by: Jamie Iles <jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
Applied, thanks.
g.
> ---
> drivers/of/base.c | 7 ++++---
> include/linux/of.h | 15 +++++++++------
> 2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 02ed367..3ff22e3 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -610,8 +610,9 @@ EXPORT_SYMBOL(of_find_node_by_phandle);
> *
> * The out_value is modified only if a valid u32 value can be decoded.
> */
> -int of_property_read_u32_array(const struct device_node *np, char *propname,
> - u32 *out_values, size_t sz)
> +int of_property_read_u32_array(const struct device_node *np,
> + const char *propname, u32 *out_values,
> + size_t sz)
> {
> struct property *prop = of_find_property(np, propname, NULL);
> const __be32 *val;
> @@ -645,7 +646,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_array);
> *
> * The out_string pointer is modified only if a valid string can be decoded.
> */
> -int of_property_read_string(struct device_node *np, char *propname,
> +int of_property_read_string(struct device_node *np, const char *propname,
> const char **out_string)
> {
> struct property *prop = of_find_property(np, propname, NULL);
> diff --git a/include/linux/of.h b/include/linux/of.h
> index bd716f8..0085bb0 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -196,12 +196,13 @@ extern struct property *of_find_property(const struct device_node *np,
> const char *name,
> int *lenp);
> extern int of_property_read_u32_array(const struct device_node *np,
> - char *propname,
> + const char *propname,
> u32 *out_values,
> size_t sz);
>
> -extern int of_property_read_string(struct device_node *np, char *propname,
> - const char **out_string);
> +extern int of_property_read_string(struct device_node *np,
> + const char *propname,
> + const char **out_string);
> extern int of_device_is_compatible(const struct device_node *device,
> const char *);
> extern int of_device_is_available(const struct device_node *device);
> @@ -242,13 +243,15 @@ static inline bool of_have_populated_dt(void)
> }
>
> static inline int of_property_read_u32_array(const struct device_node *np,
> - char *propname, u32 *out_values, size_t sz)
> + const char *propname,
> + u32 *out_values, size_t sz)
> {
> return -ENOSYS;
> }
>
> static inline int of_property_read_string(struct device_node *np,
> - char *propname, const char **out_string)
> + const char *propname,
> + const char **out_string)
> {
> return -ENOSYS;
> }
> @@ -256,7 +259,7 @@ static inline int of_property_read_string(struct device_node *np,
> #endif /* CONFIG_OF */
>
> static inline int of_property_read_u32(const struct device_node *np,
> - char *propname,
> + const char *propname,
> u32 *out_value)
> {
> return of_property_read_u32_array(np, propname, out_value, 1);
> --
> 1.7.4.1
>
prev parent reply other threads:[~2011-08-02 15:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 14:45 [PATCH] of: constify property name parameters for helper functions Jamie Iles
[not found] ` <1312296307-32527-1-git-send-email-jamie-wmLquQDDieKakBO8gow8eQ@public.gmane.org>
2011-08-02 15:51 ` Grant Likely [this message]
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=20110802155154.GA31611@ponder.secretlab.ca \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=jamie-wmLquQDDieKakBO8gow8eQ@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).