From: Vasileios Amoiridis <vassilisamir@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: lars@metafoo.de, krzysztof.kozlowski@linaro.org,
nuno.sa@analog.com, u.kleine-koenig@baylibre.com,
abhashkumarjha123@gmail.com, jstephan@baylibre.com,
dlechner@baylibre.com, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 4/6] iio: adc: max1363: make use of iio_is_soft_ts_enabled()
Date: Tue, 3 Dec 2024 23:08:20 +0100 [thread overview]
Message-ID: <Z0-BVKSCL-Pak9eA@vamoirid-laptop> (raw)
In-Reply-To: <20241130140948.1e0f1082@jic23-huawei>
On Sat, Nov 30, 2024 at 02:09:48PM +0000, Jonathan Cameron wrote:
> On Sat, 30 Nov 2024 01:27:08 +0100
> Vasileios Amoiridis <vassilisamir@gmail.com> wrote:
>
> > Use the iio_is_soft_ts_enabled() accessor to access the value of the
> > scan_timestamp. This way, it can be marked as __private when there
> > are no direct accessors of it.
> >
> > Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
> Hmm. A younger me one ;)
>
> A simple allocation that is always big enough is going to cost
> us very little. Should almost certainly be using kzalloc.
>
> I'd change this driver to just stick an array of size
> 12 * 2 + 8 so 32bytes in the iio_priv()
> (12 channels, possibly of 2 bytes each + aligned timestamp)
> and always use that for the rx_buf.
>
> Both a simplification and probably a performance improvement
> as well by dropping the frequent allocations.
>
>
Hi Jonathan,
I see your point, I can implement this as well.
Cheers,
Vasilis
> > ---
> > drivers/iio/adc/max1363.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
> > index 9a0baea08ab6..57d9aff729f4 100644
> > --- a/drivers/iio/adc/max1363.c
> > +++ b/drivers/iio/adc/max1363.c
> > @@ -1473,7 +1473,7 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
> > d_size = numvals*2;
> > else
> > d_size = numvals;
> > - if (indio_dev->scan_timestamp) {
> > + if (iio_is_soft_ts_enabled(indio_dev)) {
> > d_size += sizeof(s64);
> > if (d_size % sizeof(s64))
> > d_size += sizeof(s64) - (d_size % sizeof(s64));
>
next prev parent reply other threads:[~2024-12-03 22:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 0:27 [PATCH RFC 0/6] iio: mark scan_timestamp __private Vasileios Amoiridis
2024-11-30 0:27 ` [PATCH RFC 1/6] iio: create accessor for iio_dev->scan_timestamp Vasileios Amoiridis
2024-11-30 0:27 ` [PATCH RFC 2/6] iio: make use of iio_is_soft_ts_enabled() Vasileios Amoiridis
2024-11-30 0:27 ` [PATCH RFC 3/6] iio: adc: dln2-adc: " Vasileios Amoiridis
2024-11-30 14:02 ` Jonathan Cameron
2024-12-03 21:38 ` Vasileios Amoiridis
2024-11-30 0:27 ` [PATCH RFC 4/6] iio: adc: max1363: " Vasileios Amoiridis
2024-11-30 14:09 ` Jonathan Cameron
2024-12-03 22:08 ` Vasileios Amoiridis [this message]
2024-11-30 0:27 ` [PATCH RFC 5/6] iio: common: ssp_sensors: " Vasileios Amoiridis
2024-11-30 14:17 ` Jonathan Cameron
2024-12-03 22:10 ` Vasileios Amoiridis
2024-11-30 0:27 ` [PATCH RFC 6/6] iio: core: mark scan_timestamp as __private Vasileios Amoiridis
2024-11-30 14:19 ` Jonathan Cameron
2024-12-03 22:14 ` Vasileios Amoiridis
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=Z0-BVKSCL-Pak9eA@vamoirid-laptop \
--to=vassilisamir@gmail.com \
--cc=abhashkumarjha123@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=jstephan@baylibre.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=u.kleine-koenig@baylibre.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