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:
parent
758b62e562
commit
ac9cca7a6a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user