From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Date: Sun, 26 Jun 2016 10:11:56 +0200 Subject: [U-Boot] [PATCH v3 09/12] libfdt: Add fdt_getprop_namelen_w In-Reply-To: References: <20160624142757.32735-1-maxime.ripard@free-electrons.com> <20160624142757.32735-10-maxime.ripard@free-electrons.com> Message-ID: <20160626081156.GJ4000@lukather> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Sat, Jun 25, 2016 at 08:53:55PM -0600, Simon Glass wrote: > Hi Maxime, > > On 24 June 2016 at 08:27, Maxime Ripard > wrote: > > Add a function to retrieve a writeable property only by the first > > characters of its name. > > > > Signed-off-by: Maxime Ripard > > --- > > include/libfdt.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/include/libfdt.h b/include/libfdt.h > > index dbe8a0efca87..b8758de3ae54 100644 > > --- a/include/libfdt.h > > +++ b/include/libfdt.h > > @@ -619,6 +619,13 @@ const void *fdt_getprop_by_offset(const void *fdt, int offset, > > */ > > const void *fdt_getprop_namelen(const void *fdt, int nodeoffset, > > const char *name, int namelen, int *lenp); > > +static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset, > > + const char *name, int namelen, > > + int *lenp) > > +{ > > + return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, name, > > + namelen, lenp); > > What are the casts for? This is modelled after the already existing fdt_getprop_w. The casts just remove the const qualifier in fdt_getprop return value so that you can modify it. Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Ripard Subject: Re: [PATCH v3 09/12] libfdt: Add fdt_getprop_namelen_w Date: Sun, 26 Jun 2016 10:11:56 +0200 Message-ID: <20160626081156.GJ4000@lukather> References: <20160624142757.32735-1-maxime.ripard@free-electrons.com> <20160624142757.32735-10-maxime.ripard@free-electrons.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="enLffk0M6cffIOOh" Return-path: Content-Disposition: inline In-Reply-To: Sender: devicetree-compiler-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: To: Simon Glass Cc: Pantelis Antoniou , Boris Brezillon , Alexander Kaplan , Thomas Petazzoni , Devicetree Compiler , Antoine =?iso-8859-1?Q?T=E9nart?= , Hans de Goede , Tom Rini , U-Boot Mailing List , Stefan Agner --enLffk0M6cffIOOh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Simon, On Sat, Jun 25, 2016 at 08:53:55PM -0600, Simon Glass wrote: > Hi Maxime, >=20 > On 24 June 2016 at 08:27, Maxime Ripard > wrote: > > Add a function to retrieve a writeable property only by the first > > characters of its name. > > > > Signed-off-by: Maxime Ripard > > --- > > include/libfdt.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/include/libfdt.h b/include/libfdt.h > > index dbe8a0efca87..b8758de3ae54 100644 > > --- a/include/libfdt.h > > +++ b/include/libfdt.h > > @@ -619,6 +619,13 @@ const void *fdt_getprop_by_offset(const void *fdt,= int offset, > > */ > > const void *fdt_getprop_namelen(const void *fdt, int nodeoffset, > > const char *name, int namelen, int *len= p); > > +static inline void *fdt_getprop_namelen_w(void *fdt, int nodeoffset, > > + const char *name, int namelen, > > + int *lenp) > > +{ > > + return (void *)(uintptr_t)fdt_getprop_namelen(fdt, nodeoffset, = name, > > + namelen, lenp); >=20 > What are the casts for? This is modelled after the already existing fdt_getprop_w. The casts just remove the const qualifier in fdt_getprop return value so that you can modify it. Maxime --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --enLffk0M6cffIOOh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXb45MAAoJEBx+YmzsjxAgZ4MP/2Y4kFvx3aw+C57LJBTRBVEV C8wiHIFczoKZyxcXMk6/FA2LCrzkWVCjFZXotdZh9/ZhvnEQg5kDiTsjezpQvHdh VxIsVHMMneyGhNhJyJGd3mfQfpbLF03lAsn8Qy1Hl9fpYLxMv4o1vJlxQFax0+PD yO+5AJNAaQj9jghAe9g1WhYHNzxlwch2GfLeugvhsV6Owf0rGjhisXoeQ+Ypx7J3 v6/qwtkDYS24HcToqDpgUA7wQR/DYJTF5eqnJwXekopsYpXROF4WJFDRZpXxVGXt FYXwDWwrvs01KYg/3JWBHen9mMfDWKkFbUrs7xx2NctySMwKfOrtXpUVL2N0cjfq IlLs0AgqyzBbnOupkxHFF0LKPgwYtNJLJilkt4UwfpK+0Jdyuhe54pu/I64htYF0 r7dZue+4hFk89178cKncrbxiOTQKb2UWES0vvAZL6OJOV27n6BK/RMKTSXpQKQ5T tj4hnWBDlBhmsa1jz50+Jx+7l8Of248pJiXgshlWihF0vHg312fzU0o4Evnq21Kj GPanY9QiYqlfBIIPBv5/PTlxIAmrihoyaMRuNfhnSVgPw/LQ4cTppbikvmnD+cVi Pk5nchP1N1qQnxWxbx2YrqEW2n9stAdiGNvCC+y7se1rMPU16Fxs1Dm09uK3lKPQ jXNUHW6QzAutiztL35m+ =5gXZ -----END PGP SIGNATURE----- --enLffk0M6cffIOOh--