From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
linux-input@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [RFC/PATCH 2/5] device property: introduce notion of subnodes for legacy boards
Date: Fri, 21 Sep 2018 16:33:36 -0700 [thread overview]
Message-ID: <20180921233336.GB44099@dtor-ws> (raw)
In-Reply-To: <20180920101648.GC11965@kuha.fi.intel.com>
On Thu, Sep 20, 2018 at 01:16:48PM +0300, Heikki Krogerus wrote:
> On Wed, Sep 19, 2018 at 10:13:26AM -0700, Dmitry Torokhov wrote:
> > > > diff --git a/drivers/base/pset_property.c b/drivers/base/pset_property.c
> > > > index 08ecc13080ae..63f2377aefe8 100644
> > > > --- a/drivers/base/pset_property.c
> > > > +++ b/drivers/base/pset_property.c
> > > > @@ -18,6 +18,11 @@ struct property_set {
> > > > struct device *dev;
> > > > struct fwnode_handle fwnode;
> > > > const struct property_entry *properties;
> > > > +
> > > > + struct property_set *parent;
> > > > + /* Entry in parent->children list */
> > > > + struct list_head child_node;
> > > > + struct list_head children;
> > >
> > > Add
> > >
> > > const char *name;
> > >
> > > and you can implement also pset_get_named_child_node().
> >
> > Or
> > char name[];
> >
> > to avoid separate allocation.
>
> Let's not do that, especially if you are planning on exporting this
> structure.
Can you please elaborate why? Not using pointer saves us 4/8 bytes +
however much memory we need for bookkeeping for the extra chunk. Given
that majority of pset nodes are unnamed this seems wasteful.
> If the name is coming from .rodata, there is no need to
> allocate anything for the name. Check kstrdup_const().
The data is most likely coming as __initconst so we do need to copy it.
>
> > Alternatively, we can add it later when we need it, and add
> > device_add_named_child_properties().
> >
> > I'll leave it up to Rafael to decide.
>
> Fair enough.
>
>
> Thanks,
>
> --
> heikki
Thanks.
--
Dmitry
next prev parent reply other threads:[~2018-09-21 23:33 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 18:15 [RFC/PATCH 0/5] Support children for legacy device properties Dmitry Torokhov
2018-09-17 18:15 ` [RFC/PATCH 1/5] device property: split generic properties and property sets Dmitry Torokhov
2018-09-17 18:16 ` [RFC/PATCH 2/5] device property: introduce notion of subnodes for legacy boards Dmitry Torokhov
2018-09-19 15:10 ` Heikki Krogerus
2018-09-19 17:13 ` Dmitry Torokhov
2018-09-20 10:16 ` Heikki Krogerus
2018-09-21 23:33 ` Dmitry Torokhov [this message]
2018-09-24 7:29 ` Heikki Krogerus
2018-09-20 13:53 ` Heikki Krogerus
2018-09-21 15:36 ` Linus Walleij
2018-09-24 10:20 ` Heikki Krogerus
2018-09-21 23:31 ` Dmitry Torokhov
2018-09-24 13:20 ` Heikki Krogerus
2018-09-24 18:45 ` Dmitry Torokhov
2018-09-25 12:19 ` Heikki Krogerus
2018-10-05 21:47 ` Dmitry Torokhov
2018-10-11 8:18 ` Heikki Krogerus
2018-09-17 18:16 ` [RFC/PATCH 3/5] device property: export property_set structure Dmitry Torokhov
2018-09-17 18:16 ` [RFC/PATCH 4/5] gpiolib: add support for fetching descriptors from static properties Dmitry Torokhov
2018-09-18 9:02 ` Mika Westerberg
2018-09-18 17:04 ` Dmitry Torokhov
2018-09-19 8:33 ` Mika Westerberg
2018-09-17 18:16 ` [RFC/PATCH 5/5] RFC: ARM: simone: Hacked in keys Dmitry Torokhov
2018-09-18 4:23 ` [RFC/PATCH 0/5] Support children for legacy device properties Andy Shevchenko
2018-09-18 20:05 ` Rafael J. Wysocki
2018-09-19 19:55 ` Linus Walleij
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=20180921233336.GB44099@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.