[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220506094339.55b8aa63@fixe.home>
Date: Fri, 6 May 2022 09:43:39 +0200
From: Clément Léger <clement.leger@...tlin.com>
To: Rob Herring <robh@...nel.org>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Frank Rowand <frowand.list@...il.com>,
Nathan Lynch <nathanl@...ux.ibm.com>,
Laurent Dufour <ldufour@...ux.ibm.com>,
Daniel Henrique Barboza <danielhb413@...il.com>,
David Gibson <david@...son.dropbear.id.au>,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Ohhoon Kwon <ohoono.kwon@...sung.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
YueHaibing <yuehaibing@...wei.com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Steen Hegelund <steen.hegelund@...rochip.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Allan Nielsen <allan.nielsen@...rochip.com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
Horatiu Vultur <horatiu.vultur@...rochip.com>
Subject: Re: [PATCH 1/3] of: dynamic: add of_property_alloc() and
of_property_free()
Le Thu, 5 May 2022 12:37:38 -0500,
Rob Herring <robh@...nel.org> a écrit :
> > >
> > > - /* mark the property as dynamic */
> > > - of_property_set_flag(new, OF_DYNAMIC);
> > > + prop->value = kzalloc(alloc_len, allocflags);
> > > + if (!prop->value)
> > > + goto out_err;
> > >
> > > - return new;
> > > + if (value)
> > > + memcpy(prop->value, value, value_len);
> >
> > Could you use kmemdup() instead of kzalloc+memcpy ?
>
> I'd prefer there be 1 alloc for struct property and value instead of 2.
> And maybe 'name' gets rolled into it too, but that gets a bit more
> complicated to manage I think.
At least for value it should be easy indeed. i'll check what I can do
for the name.
>
> With memcpy, note this series[1].
Ok, good to know, should I base my series on that one ?
>
> Rob
>
> [1] https://lore.kernel.org/all/20220504014440.3697851-30-keescook@chromium.org/
--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com
Powered by blists - more mailing lists