[PATCH] w1: w1_therm: Use max() instead of doing it manually

From: Haowen Bai
Date: Thu Mar 10 2022 - 05:31:00 EST


Fix following coccicheck warning:
drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max()

Signed-off-by: Haowen Bai <baihaowen@xxxxxxxxx>
---
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