aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorShen Lichuan <shenlichuan@vivo.com>2024-08-27 15:04:42 +0800
committerGuenter Roeck <linux@roeck-us.net>2024-08-27 08:12:23 -0700
commitac9cca7a6a17c6d8bd849be669005fac0420d4b5 (patch)
tree0eeb9b3bee4bcf78dbcca37fbe3f3541b1567d25 /drivers/hwmon
parent758b62e562f2fdffd26a84dbeafbe6888a7e130c (diff)
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/pc87360.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
index 9e9681b2e8c5..788b5d58f77e 100644
--- a/drivers/hwmon/pc87360.c
+++ b/drivers/hwmon/pc87360.c
@@ -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);