1

hwmon: (pc87360) Use min() macro

Use the min() macro to simplify the pc87360_init_device() function
and improve its readability.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Message-ID: <20240827070442.40667-1-shenlichuan@vivo.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Shen Lichuan 2024-08-27 15:04:42 +08:00 committed by Guenter Roeck
parent 758b62e562
commit ac9cca7a6a

View File

@ -1315,7 +1315,7 @@ static void pc87360_init_device(struct platform_device *pdev,
(reg & 0xC0) | 0x11);
}
nr = data->innr < 11 ? data->innr : 11;
nr = min(data->innr, 11);
for (i = 0; i < nr; i++) {
reg = pc87360_read_value(data, LD_IN, i,
PC87365_REG_IN_STATUS);