From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============8992184358269021223==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix minmax.cocci warnings Date: Sat, 12 Feb 2022 01:58:24 +0800 Message-ID: <20220211175824.GA26682@af9116151f38> In-Reply-To: <202202120151.E3D1k9yN-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============8992184358269021223== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Jakub Kicinski CC: netdev(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min() 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: f1baf68e1383f6ed93eb9cff2866d46562607a43 commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minm= ax script :::::: branch date: 18 hours ago :::::: commit date: 10 months ago Please take the patch only if it's a positive warning. Thanks! smc911x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c @@ -480,7 +480,7 @@ static void smc911x_hardware_send_pkt(st SMC_SET_TX_FIFO(lp, cmdB); = DBG(SMC_DEBUG_PKTS, dev, "Transmitted packet\n"); - PRINT_PKT(buf, len <=3D 64 ? len : 64); + PRINT_PKT(buf, min(len, 64)); = /* Send pkt via PIO or DMA */ #ifdef SMC_USE_DMA --===============8992184358269021223==--