Commit ac9cca7a authored by Shen Lichuan's avatar Shen Lichuan Committed by Guenter Roeck

hwmon: (pc87360) Use min() macro

Use the min() macro to simplify the pc87360_init_device() function
and improve its readability.
Signed-off-by: default avatarShen Lichuan <shenlichuan@vivo.com>
Message-ID: <20240827070442.40667-1-shenlichuan@vivo.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 758b62e5
...@@ -1315,7 +1315,7 @@ static void pc87360_init_device(struct platform_device *pdev, ...@@ -1315,7 +1315,7 @@ static void pc87360_init_device(struct platform_device *pdev,
(reg & 0xC0) | 0x11); (reg & 0xC0) | 0x11);
} }
nr = data->innr < 11 ? data->innr : 11; nr = min(data->innr, 11);
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
reg = pc87360_read_value(data, LD_IN, i, reg = pc87360_read_value(data, LD_IN, i,
PC87365_REG_IN_STATUS); PC87365_REG_IN_STATUS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment