From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Hardware Monitoring <linux-hwmon@vger.kernel.org>
Subject: Re: [PATCH 2/6] hwmon: (lm95234) Use find_closest to find matching update interval
Date: Fri, 19 Jul 2024 00:39:55 +0800 [thread overview]
Message-ID: <ZplFW4rL5qhxbT0M@tzungbi-laptop> (raw)
In-Reply-To: <20240718033935.205185-3-linux@roeck-us.net>
On Wed, Jul 17, 2024 at 08:39:31PM -0700, Guenter Roeck wrote:
> @@ -471,10 +472,7 @@ static ssize_t update_interval_store(struct device *dev,
> if (ret < 0)
> return ret;
>
> - for (regval = 0; regval < 3; regval++) {
> - if (val <= update_intervals[regval])
> - break;
> - }
> + regval = find_closest(val, update_intervals, ARRAY_SIZE(update_intervals));
The behavior changed.
static u16 update_intervals[] = { 143, 364, 1000, 2500 };
If val = 144,
* Originally, regval = 1.
* After applying the patch, regval = 0.
next prev parent reply other threads:[~2024-07-18 16:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 3:39 [PATCH 0/6] hwmon: (lm9534) Various improvements Guenter Roeck
2024-07-18 3:39 ` [PATCH 1/6] hwmon: (lm95234) Reorder include files to be in alphabetic order Guenter Roeck
2024-07-18 16:39 ` Tzung-Bi Shih
2024-07-18 3:39 ` [PATCH 2/6] hwmon: (lm95234) Use find_closest to find matching update interval Guenter Roeck
2024-07-18 16:39 ` Tzung-Bi Shih [this message]
2024-07-18 17:48 ` Guenter Roeck
2024-07-18 17:53 ` Guenter Roeck
2024-07-19 0:52 ` Tzung-Bi Shih
2024-07-18 3:39 ` [PATCH 3/6] hwmon: (lm95234) Convert to use regmap Guenter Roeck
2024-07-18 16:40 ` Tzung-Bi Shih
2024-07-18 3:39 ` [PATCH 4/6] hwmon: (lm95234) Convert to with_info hwmon API Guenter Roeck
2024-07-18 16:40 ` Tzung-Bi Shih
2024-07-18 17:47 ` Guenter Roeck
2024-07-19 0:52 ` Tzung-Bi Shih
2024-07-19 1:55 ` Guenter Roeck
2024-07-18 3:39 ` [PATCH 5/6] hwmon: (lm95234) Add support for tempX_enable attribute Guenter Roeck
2024-07-18 16:40 ` Tzung-Bi Shih
2024-07-18 3:39 ` [PATCH 6/6] hwmon: (lm95234) Use multi-byte regmap operations Guenter Roeck
2024-07-18 16:40 ` Tzung-Bi Shih
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=ZplFW4rL5qhxbT0M@tzungbi-laptop \
--to=tzungbi@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
/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