[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1646908169-8050-1-git-send-email-baihaowen@meizu.com>
Date: Thu, 10 Mar 2022 18:29:29 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: <zbr@...emap.net>
CC: <linux-kernel@...r.kernel.org>, Haowen Bai <baihaowen@...zu.com>
Subject: [PATCH] w1: w1_therm: Use max() instead of doing it manually
Fix following coccicheck warning:
drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max()
Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
drivers/w1/slaves/w1_therm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 5655780..e430d85 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -1449,7 +1449,7 @@ static int trigger_bulk_read(struct w1_master *dev_master)
if (bulk_read_support(sl)) {
int t_cur = conversion_time(sl);
- t_conv = t_cur > t_conv ? t_cur : t_conv;
+ t_conv = max(t_cur, t_conv);
strong_pullup = strong_pullup ||
(w1_strong_pullup == 2 ||
(!SLAVE_POWERMODE(sl) &&
--
2.7.4
Powered by blists - more mailing lists