[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211227113632.90672-1-jiapeng.chong@linux.alibaba.com>
Date: Mon, 27 Dec 2021 19:36:32 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: mezin.alexander@...il.com
Cc: jdelvare@...e.com, linux@...ck-us.net, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH] hwmon: Use min() instead of doing it manually
Eliminate following coccicheck warning:
./drivers/hwmon/nzxt-smart2.c:461:12-13: WARNING opportunity for min().
Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
drivers/hwmon/nzxt-smart2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/nzxt-smart2.c b/drivers/hwmon/nzxt-smart2.c
index 534d39b8908e..b30de7441fbb 100644
--- a/drivers/hwmon/nzxt-smart2.c
+++ b/drivers/hwmon/nzxt-smart2.c
@@ -458,7 +458,7 @@ static int send_output_report(struct drvdata *drvdata, const void *data,
ret = hid_hw_output_report(drvdata->hid, drvdata->output_buffer,
sizeof(drvdata->output_buffer));
- return ret < 0 ? ret : 0;
+ return min(ret, 0);
}
static int set_pwm(struct drvdata *drvdata, int channel, long val)
--
2.20.1.7.g153144c
Powered by blists - more mailing lists