[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aF6895xeiB19A6ig@black.fi.intel.com>
Date: Fri, 27 Jun 2025 18:47:03 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Ahmad Fatoum <a.fatoum@...gutronix.de>,
Kent Gibson <warthog618@...il.com>,
Jan Lübbe <jlu@...gutronix.de>,
Marek Vasut <marex@...x.de>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Linus Walleij <linus.walleij@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2 6/9] gpio: sysfs: don't look up exported lines as
class devices
On Mon, Jun 23, 2025 at 10:59:54AM +0200, Bartosz Golaszewski wrote:
>
> In preparation for adding a parallel, per-chip attribute group for
> exported GPIO lines, stop using class device APIs to refer to it in the
> code. When unregistering the chip, don't call class_find_device() but
> instead store exported lines in a linked list inside the GPIO chip data
> object and look it up there.
...
> + struct list_head list;
> };
If you make this to be the first member, you may make the container_of() (from
list_entry APIs) to be no-op. Have you checked with bloat-o-meter the difference?
...
> + struct list_head exported_lines;
> };
Ditto.
...
> - desc_data->value_class_node = sysfs_get_dirent(dev->kobj.sd, "value");
> + desc_data->value_class_node = sysfs_get_dirent(desc_data->dev->kobj.sd,
> + "value");
In such cases I find the following style to be slightly better to read.
desc_data->value_class_node =
sysfs_get_dirent(desc_data->dev->kobj.sd, "value");
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists