mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Trent Piepho <tpiepho@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] of: base: constify some property pointers
Date: Mon, 31 May 2021 09:23:49 +0200	[thread overview]
Message-ID: <20210531072349.GH5211@pengutronix.de> (raw)
In-Reply-To: <20210529062541.1123023-1-tpiepho@gmail.com>

On Fri, May 28, 2021 at 11:25:41PM -0700, Trent Piepho wrote:
> Make the propery pointers in a few OF functions that read data const.
> They don't modify the property.
> 
> Signed-off-by: Trent Piepho <tpiepho@gmail.com>
> ---
>  drivers/of/base.c |  4 ++--
>  include/of.h      | 10 +++++-----
>  2 files changed, 7 insertions(+), 7 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 6fe02649e..04814c8f7 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1048,7 +1048,7 @@ int of_property_match_string(struct device_node *np, const char *propname,
>  }
>  EXPORT_SYMBOL_GPL(of_property_match_string);
>  
> -const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
> +const __be32 *of_prop_next_u32(const struct property *prop, const __be32 *cur,
>  			u32 *pu)
>  {
>  	const void *curv = cur;
> @@ -1074,7 +1074,7 @@ out_val:
>  }
>  EXPORT_SYMBOL_GPL(of_prop_next_u32);
>  
> -const char *of_prop_next_string(struct property *prop, const char *cur)
> +const char *of_prop_next_string(const struct property *prop, const char *cur)
>  {
>  	const void *curv = cur;
>  	const void *value;
> diff --git a/include/of.h b/include/of.h
> index 645f429bd..4adbb7d54 100644
> --- a/include/of.h
> +++ b/include/of.h
> @@ -95,7 +95,7 @@ static inline void of_write_number(void *__cell, u64 val, int size)
>  	}
>  }
>  
> -static inline const void *of_property_get_value(struct property *pp)
> +static inline const void *of_property_get_value(const struct property *pp)
>  {
>  	return pp->value ? pp->value : pp->value_const;
>  }
> @@ -216,9 +216,9 @@ extern int of_property_read_string_helper(const struct device_node *np,
>  					      const char *propname,
>  					      const char **out_strs, size_t sz, int index);
>  
> -extern const __be32 *of_prop_next_u32(struct property *prop,
> +extern const __be32 *of_prop_next_u32(const struct property *prop,
>  				const __be32 *cur, u32 *pu);
> -extern const char *of_prop_next_string(struct property *prop, const char *cur);
> +extern const char *of_prop_next_string(const struct property *prop, const char *cur);
>  
>  extern int of_property_write_bool(struct device_node *np,
>  				const char *propname, const bool value);
> @@ -520,13 +520,13 @@ static inline int of_property_read_string_helper(const struct device_node *np,
>  	return -ENOSYS;
>  }
>  
> -static inline const __be32 *of_prop_next_u32(struct property *prop,
> +static inline const __be32 *of_prop_next_u32(const struct property *prop,
>  					const __be32 *cur, u32 *pu)
>  {
>  	return 0;
>  }
>  
> -static inline const char *of_prop_next_string(struct property *prop,
> +static inline const char *of_prop_next_string(const struct property *prop,
>  					const char *cur)
>  {
>  	return NULL;
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-05-31  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-29  6:25 Trent Piepho
2021-05-31  7:23 ` Sascha Hauer [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=20210531072349.GH5211@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=tpiepho@gmail.com \
    --subject='Re: [PATCH] of: base: constify some property pointers' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox