All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Mehdi Djait <mehdi.djait.k@gmail.com>, jic23@kernel.org
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 0/2] iio: accel: kionix-kx022a: Minor fixes
Date: Wed, 1 Feb 2023 07:36:19 +0200	[thread overview]
Message-ID: <0f6fe3bc-6626-9ad4-3eb6-9a603a360329@gmail.com> (raw)
In-Reply-To: <Y9lwoMIPD134k0dy@carbian>

On 1/31/23 21:48, Mehdi Djait wrote:
> Hi Matti,
> 
> On Mon, Jan 30, 2023 at 10:15:51AM +0200, Matti Vaittinen wrote:
>> On 1/29/23 15:37, Mehdi Djait wrote:

> 
>          /*
>          * The only difference would be to store the g_range value in the
>          * driver private struct when the user changes it from sysfs
>          * (in this case I defined an array called kx022a_g_range_table)
>          */
> 
>          data->g_range = kx022a_g_range_table[n];
> 

Ok. Thanks for the clarification. In that case, as I mentioned below:

 >> Do you mean caching the g_range instead of retrieving it from the 
hardware?
 >> I don't know an use-case where reading the range would be 
time-critical -
 >> and even if it was, the regmap should cache the value anyways. (unless
 >> KX022A_REG_CNTL is in volatile range). So no, I don't think caching the
 >> g_range is worth it.

I don't think it makes much difference. The regmap should cache the 
value anyways. So, to be honest, I don't think it's worth the space and 
code - unless the GSEL reg was in volatile range for some reason - and 
even in that case the benefit might not be so big because AFAIR, the 
g-range is not read for every sample.

Yours,
	-- Matti

-- 
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~


      reply	other threads:[~2023-02-01  5:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29 13:37 [PATCH 0/2] iio: accel: kionix-kx022a: Minor fixes Mehdi Djait
2023-01-29 13:37 ` [PATCH 1/2] iio: accel: kionix-kx022a: Fix the setting of regmap_config rd_table and wr_table Mehdi Djait
2023-01-30  7:37   ` Matti Vaittinen
2023-01-31 19:32     ` Mehdi Djait
2023-01-29 13:37 ` [PATCH 2/2] iio: accel: kionix-kx022a: Remove the unused member g_range Mehdi Djait
2023-01-30  8:17   ` Matti Vaittinen
2023-02-05 14:56     ` Jonathan Cameron
2023-01-30  8:15 ` [PATCH 0/2] iio: accel: kionix-kx022a: Minor fixes Matti Vaittinen
2023-01-31 19:48   ` Mehdi Djait
2023-02-01  5:36     ` Matti Vaittinen [this message]

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=0f6fe3bc-6626-9ad4-3eb6-9a603a360329@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=mehdi.djait.k@gmail.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.