mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Rodrigo Alencar via B4 Relay
	<devnull+rodrigo.alencar.analog.com@kernel.org>
Cc: rodrigo.alencar@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH RFC 5/5] iio: sysfs: drop core-only fields from struct iio_dev_attr
Date: Sat, 21 Nov 2026 01:36:39 +0000	[thread overview]
Message-ID: <20261121013639.14e8d5bb@jic23-hlaptop> (raw)
In-Reply-To: <20261120-iio-core-attr-review-v1-5-05b41f8133c2@analog.com>

On Fri, 20 Nov 2026 18:04:01 +0000
Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org> wrote:

> From: Rodrigo Alencar <rodrigo.alencar@analog.com>
> 
> The list node, channel spec and buffer pointer of struct iio_dev_attr
> are now only used through struct iio_chan_attr and the types extending
> it. Remove them, so that attributes declared by drivers through
> IIO_DEVICE_ATTR*() and friends no longer carry them.
> 
> On 64-bit, without lockdep, this shrinks struct iio_dev_attr from 72 to
> 40 bytes.
> 
> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>

Trivial but I think it would be nicer to drop each element
as it stops being used in earlier patches. That would make
it obvious how things are migrating to each level of more specific
structure.


Overall I like this set. Bringing my horrible hacky mess
into the modern world :)

Core code though so I'm not going to jump on picking it up
until folk have had a good chance to look at it.

I was tempted though as it's been a long day and nice
to see something that reduces technical debt go in!

Passing comment inline. No actual changes suggested!




> ---
>  include/linux/iio/sysfs.h | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
> index de5bb125815c..1e4122b8c13a 100644
> --- a/include/linux/iio/sysfs.h
> +++ b/include/linux/iio/sysfs.h
> @@ -9,23 +9,14 @@
>  #ifndef _INDUSTRIAL_IO_SYSFS_H_
>  #define _INDUSTRIAL_IO_SYSFS_H_
>  
> -struct iio_buffer;
> -struct iio_chan_spec;
> -
>  /**
>   * struct iio_dev_attr - iio specific device attribute
>   * @dev_attr:	underlying device attribute
>   * @address:	associated register address
> - * @l:		list head for maintaining list of dynamically created attrs
> - * @c:		specification for the underlying channel
> - * @buffer:	the IIO buffer to which this attribute belongs to (if any)
>   */
>  struct iio_dev_attr {
>  	struct device_attribute dev_attr;
>  	u64 address;

This is close to device_attribute_ext but I checked and there are few
if any points pushed into that address. 

> -	struct list_head l;
> -	struct iio_chan_spec const *c;
> -	struct iio_buffer *buffer;
>  };
>  
>  #define to_iio_dev_attr(_dev_attr)				\
> 


  reply	other threads:[~2026-11-21  1:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 18:03 [PATCH RFC 0/5] iio: split struct iio_dev_attr into typed core attributes Rodrigo Alencar via B4 Relay
2026-11-20 18:03 ` [PATCH RFC 1/5] iio: buffer: add iio_attr_to_buffer() helper Rodrigo Alencar via B4 Relay
2026-11-20 18:03 ` [PATCH RFC 2/5] iio: core: add struct iio_chan_attr and split attribute creation Rodrigo Alencar via B4 Relay
2026-11-21  1:25   ` Jonathan Cameron
2026-11-20 18:03 ` [PATCH RFC 3/5] iio: event: add struct iio_event_attr Rodrigo Alencar via B4 Relay
2026-11-20 18:04 ` [PATCH RFC 4/5] iio: buffer: add struct iio_buffer_attr Rodrigo Alencar via B4 Relay
2026-11-21  1:52   ` Jonathan Cameron
2026-11-20 18:04 ` [PATCH RFC 5/5] iio: sysfs: drop core-only fields from struct iio_dev_attr Rodrigo Alencar via B4 Relay
2026-11-21  1:36   ` Jonathan Cameron [this message]
2026-11-21  1:39 ` [PATCH RFC 0/5] iio: split struct iio_dev_attr into typed core attributes Jonathan Cameron

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=20261121013639.14e8d5bb@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=devnull+rodrigo.alencar.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.alencar@analog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®