[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b3fbd4e8-8d63-4769-8b9a-2f4f0eed882f@roeck-us.net>
Date: Sun, 18 Jan 2026 17:45:00 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Frank Li <Frank.li@....com>
Cc: Mayank Mahajan <mayankmahajan.x@....com>, corbet@....net,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
linux-hwmon@...r.kernel.org, devicetree@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
priyanka.jain@....com, vikash.bansal@....com
Subject: Re: [PATCH v4 2/3] hwmon: (tmp108) Add support for P3T1035 and
P3T2030
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
Powered by blists - more mailing lists