From: Guenter Roeck <linux@roeck-us.net>
To: Frank Li <Frank.li@nxp.com>
Cc: Mayank Mahajan <mayankmahajan.x@nxp.com>,
corbet@lwn.net, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, linux-hwmon@vger.kernel.org,
devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, priyanka.jain@nxp.com,
vikash.bansal@nxp.com
Subject: Re: [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and P3T2030
Date: Sun, 18 Jan 2026 17:45:00 -0800 [thread overview]
Message-ID: <b3fbd4e8-8d63-4769-8b9a-2f4f0eed882f@roeck-us.net> (raw)
In-Reply-To: <aW0Ywij9SDXPDMIj@lizhi-Precision-Tower-5810>
Frank,
On 1/18/26 09:30, Frank Li wrote:
...
>>>> @@ -101,21 +120,7 @@ static int tmp108_read(struct device *dev, enum hwmon_sensor_types type,
>>>> ®val);
>>>> if (err < 0)
>>>> return err;
>>>> - switch (regval & TMP108_CONF_CONVRATE_MASK) {
>>>> - case TMP108_CONVRATE_0P25HZ:
>>>> - default:
>>>> - *temp = 4000;
>>>> - break;
>>>> - case TMP108_CONVRATE_1HZ:
>>>> - *temp = 1000;
>>>> - break;
>>>> - case TMP108_CONVRATE_4HZ:
>>>> - *temp = 250;
>>>> - break;
>>>> - case TMP108_CONVRATE_16HZ:
>>>> - *temp = 63;
>>>> - break;
>>>> - }
>>>> + *temp = tmp108->sample_times[FIELD_GET(TMP108_CONF_CONVRATE_FLD, regval)];
>>>
>>> This code optimation need seperate patch.
>>>
>> No, There are now two ranges, not just one.
>
> Previous code use swtich case to handle sample. now convert to use a map
> array tmp108_sample_times[].
>
> My means use a small patch convert existed switch case to map array firstly
> , then add second range, which make code easy to review.
>
You are not signed up as reviewer of this driver. I am, and I don't want to see
a separate patch just for this because it means extra work for me.
Thanks,
Guenter
next prev parent reply other threads:[~2026-01-19 1:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-16 11:35 [PATCH v4 1/3] dt-bindings: hwmon: ti,tmp108: Add P3T1035,P3T2030 Mayank Mahajan
2026-01-16 11:35 ` [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and P3T2030 Mayank Mahajan
2026-01-16 21:37 ` kernel test robot
2026-01-16 22:28 ` Frank Li
2026-01-17 0:36 ` Guenter Roeck
2026-01-18 17:30 ` Frank Li
2026-01-19 1:45 ` Guenter Roeck [this message]
2026-01-16 11:35 ` [PATCH v4 3/3] hwmon: (tmp108) Add P3T1035 and P3T2030 support Mayank Mahajan
2026-01-16 14:38 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,tmp108: Add P3T1035,P3T2030 Krzysztof Kozlowski
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=b3fbd4e8-8d63-4769-8b9a-2f4f0eed882f@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Frank.li@nxp.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mayankmahajan.x@nxp.com \
--cc=priyanka.jain@nxp.com \
--cc=robh@kernel.org \
--cc=vikash.bansal@nxp.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®