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

Haowen Bai posted 1 patch 4 years, 3 months ago
drivers/w1/slaves/w1_therm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] w1: w1_therm: Use max() instead of doing it manually
Posted by Haowen Bai 4 years, 3 months ago
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>
---
 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
Re: [PATCH] w1: w1_therm: Use max() instead of doing it manually
Posted by Krzysztof Kozlowski 3 years, 1 month ago
On Thu, 10 Mar 2022 18:29:29 +0800, Haowen Bai wrote:
> Fix following coccicheck warning:
> drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max()
> 
> 

Applied, thanks!

[1/1] w1: w1_therm: Use max() instead of doing it manually
      https://git.kernel.org/krzk/linux-w1/c/1aa75bf5174c8243505a27476422060fce630cb1

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>