From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5201800086484966897==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix minmax.cocci warnings Date: Sat, 26 Feb 2022 19:57:28 +0800 Message-ID: <20220226115728.GA23471@bdc661bfb133> In-Reply-To: <202202261914.RRt3jpY2-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============5201800086484966897== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Evgeniy Polyakov CC: "Greg Kroah-Hartman" CC: Bhaskar Chowdhury CC: Randy Dunlap CC: Dan Carpenter CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max() Check for opencoded min(), max() implementations. Generated patches sometimes require adding a cast to fix compile warning. Warnings/patches scope intentionally limited to a function body. Generated by: scripts/coccinelle/misc/minmax.cocci CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 9137eda53752ef73148e42b0d7640a00f1bc96b1 commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minm= ax script :::::: branch date: 14 hours ago :::::: commit date: 10 months ago Please take the patch only if it's a positive warning. Thanks! drivers/w1/slaves/w1_therm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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_m if (bulk_read_support(sl)) { int t_cur =3D conversion_time(sl); = - t_conv =3D t_cur > t_conv ? t_cur : t_conv; + t_conv =3D max(t_cur, t_conv); strong_pullup =3D strong_pullup || (w1_strong_pullup =3D=3D 2 || (!SLAVE_POWERMODE(sl) && --===============5201800086484966897==--