w1: w1_therm: Use max() instead of doing it manually
authorHaowen Bai <baihaowen@meizu.com>
Thu, 10 Mar 2022 10:29:29 +0000 (18:29 +0800)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 8 May 2023 06:14:51 +0000 (08:14 +0200)
Fix following coccicheck warning:
drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max()

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1646908169-8050-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/w1/slaves/w1_therm.c

index 99c58bd9d2df0a7c40ef38eb9170d9d0a87d06e0..fa7c162c661f75c0ef0079994c1edaa14a6cbbcd 100644 (file)
@@ -1512,7 +1512,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) &&