* [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list
@ 2025-07-25 6:32 Nuno Sá via B4 Relay
2025-07-25 8:47 ` Andy Shevchenko
2025-07-27 12:33 ` Jonathan Cameron
0 siblings, 2 replies; 4+ messages in thread
From: Nuno Sá via B4 Relay @ 2025-07-25 6:32 UTC (permalink / raw)
To: linux-iio; +Cc: Jonathan Cameron, David Lechner, Andy Shevchenko
From: Nuno Sá <nuno.sa@analog.com>
Drop the call to INIT_LIST_HEAD(&cb_buff->buffer.demux_list). That's
already done in iio_buffer_init(&cb_buff->buffer).
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
drivers/iio/buffer/industrialio-buffer-cb.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
index 4befc9f55201e..3e27385069edb 100644
--- a/drivers/iio/buffer/industrialio-buffer-cb.c
+++ b/drivers/iio/buffer/industrialio-buffer-cb.c
@@ -68,7 +68,6 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev,
cb_buff->private = private;
cb_buff->cb = cb;
cb_buff->buffer.access = &iio_cb_access;
- INIT_LIST_HEAD(&cb_buff->buffer.demux_list);
cb_buff->channels = iio_channel_get_all(dev);
if (IS_ERR(cb_buff->channels)) {
---
base-commit: a10185367eccb4d79efdeb09eb59c964ca7659f7
change-id: 20250725-iio-minor-cleanup-94a31748efc5
--
Thanks!
- Nuno Sá
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list
2025-07-25 6:32 [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list Nuno Sá via B4 Relay
@ 2025-07-25 8:47 ` Andy Shevchenko
2025-07-25 9:04 ` Nuno Sá
2025-07-27 12:33 ` Jonathan Cameron
1 sibling, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2025-07-25 8:47 UTC (permalink / raw)
To: nuno.sa; +Cc: linux-iio, Jonathan Cameron, David Lechner, Andy Shevchenko
On Fri, Jul 25, 2025 at 9:32 AM Nuno Sá via B4 Relay
<devnull+nuno.sa.analog.com@kernel.org> wrote:
>
> From: Nuno Sá <nuno.sa@analog.com>
>
> Drop the call to INIT_LIST_HEAD(&cb_buff->buffer.demux_list). That's
> already done in iio_buffer_init(&cb_buff->buffer).
LGTM,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
...
> cb_buff->buffer.access = &iio_cb_access;
> - INIT_LIST_HEAD(&cb_buff->buffer.demux_list);
Looking at this I think ideally it would be nice to have the buffer
type to be hidden from the users and only available via
getters/setters.
> cb_buff->channels = iio_channel_get_all(dev);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list
2025-07-25 8:47 ` Andy Shevchenko
@ 2025-07-25 9:04 ` Nuno Sá
0 siblings, 0 replies; 4+ messages in thread
From: Nuno Sá @ 2025-07-25 9:04 UTC (permalink / raw)
To: Andy Shevchenko
Cc: nuno.sa, linux-iio, Jonathan Cameron, David Lechner,
Andy Shevchenko
On Fri, Jul 25, 2025 at 10:47:19AM +0200, Andy Shevchenko wrote:
> On Fri, Jul 25, 2025 at 9:32 AM Nuno Sá via B4 Relay
> <devnull+nuno.sa.analog.com@kernel.org> wrote:
> >
> > From: Nuno Sá <nuno.sa@analog.com>
> >
> > Drop the call to INIT_LIST_HEAD(&cb_buff->buffer.demux_list). That's
> > already done in iio_buffer_init(&cb_buff->buffer).
>
> LGTM,
> Reviewed-by: Andy Shevchenko <andy@kernel.org>
>
> ...
>
> > cb_buff->buffer.access = &iio_cb_access;
> > - INIT_LIST_HEAD(&cb_buff->buffer.demux_list);
>
> Looking at this I think ideally it would be nice to have the buffer
> type to be hidden from the users and only available via
> getters/setters.
I would say it's arguable at the very least. The buffer callback is
itself a buffer implementation (extends the inner buffer object) so it
kind of make senses it can access it's internals via buffer_impl.h.
Note that 'struct iio_buffer buffer' is not a pointer in 'struct
iio_cb_buffer'...
- Nuno Sá
>
> > cb_buff->channels = iio_channel_get_all(dev);
>
>
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list
2025-07-25 6:32 [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list Nuno Sá via B4 Relay
2025-07-25 8:47 ` Andy Shevchenko
@ 2025-07-27 12:33 ` Jonathan Cameron
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2025-07-27 12:33 UTC (permalink / raw)
To: Nuno Sá via B4 Relay
Cc: nuno.sa, linux-iio, David Lechner, Andy Shevchenko
On Fri, 25 Jul 2025 07:32:55 +0100
Nuno Sá via B4 Relay <devnull+nuno.sa.analog.com@kernel.org> wrote:
> From: Nuno Sá <nuno.sa@analog.com>
>
> Drop the call to INIT_LIST_HEAD(&cb_buff->buffer.demux_list). That's
> already done in iio_buffer_init(&cb_buff->buffer).
>
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Applied. Thanks,
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-27 12:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 6:32 [PATCH] iio: buffer: buffer-cb: drop double initialization of demux list Nuno Sá via B4 Relay
2025-07-25 8:47 ` Andy Shevchenko
2025-07-25 9:04 ` Nuno Sá
2025-07-27 12:33 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox