All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] coccinelle: misc: fix minmax.cocci warnings
Date: Sat, 12 Feb 2022 01:58:24 +0800	[thread overview]
Message-ID: <20220211175824.GA26682@af9116151f38> (raw)
In-Reply-To: <202202120151.E3D1k9yN-lkp@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1565 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

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 <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f1baf68e1383f6ed93eb9cff2866d46562607a43
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax 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 <= 64 ? len : 64);
+	PRINT_PKT(buf, min(len, 64));
 
 	/* Send pkt via PIO or DMA */
 #ifdef SMC_USE_DMA

  reply	other threads:[~2022-02-11 17:58 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 17:59 drivers/net/ethernet/smsc/smc911x.c:483:20-22: WARNING opportunity for min() kernel test robot
2022-02-11 17:58 ` kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-04-28 15:23 drivers/dma/sprd-dma.c:685:23-24: WARNING opportunity for max() kernel test robot
2022-04-28 15:17 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-26  9:52 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-04-26  9:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-23 22:58 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-04-23 22:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-23 11:53 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
2022-04-23 11:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-21 23:47 net/rxrpc/input.c:870:38-39: WARNING opportunity for min() kernel test robot
2022-04-21 23:40 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-21 10:13 drivers/spi/spi-fsl-lpspi.c:446:12-14: WARNING opportunity for min() kernel test robot
2022-04-21 10:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-16 17:52 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-04-16 17:49 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-15 16:02 drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c:348:85-86: WARNING opportunity for max() kernel test robot
2022-04-15 15:58 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-06  9:00 drivers/net/wireless/ath/ath9k/ar9003_phy.c:1829:19-21: WARNING opportunity for min() kernel test robot
2022-04-06  8:52 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-04-02  5:38 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-04-02  5:28 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-31  8:33 drivers/input/joystick/adi.c:395:13-14: WARNING opportunity for min() kernel test robot
2022-03-31  8:30 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-31  1:56 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-03-31  1:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-28 12:05 sound/core/seq/seq_ports.c:142:12-14: WARNING opportunity for max() kernel test robot
2022-03-28 12:03 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-25  2:13 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
2022-03-25  2:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-21 12:01 arch/mips/sibyte/common/sb_tbprof.c:462:19-20: WARNING opportunity for min() kernel test robot
2022-03-21 11:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-20  4:32 drivers/scsi/cxlflash/vlun.c:448:30-31: WARNING opportunity for min() kernel test robot
2022-03-20  4:31 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-20  4:01 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-20  3:57 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-18  8:16 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-18  8:10 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-16 16:54 drivers/usb/storage/realtek_cr.c:264:20-21: WARNING opportunity for min() kernel test robot
2022-03-16 16:51 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-15  9:07 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-15  9:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-13  0:39 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-03-13  0:37 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-12  8:34 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-12  8:27 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-03-10  1:59 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-03-10  1:58 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-27 19:50 drivers/staging/most/video/video.c:176:22-23: WARNING opportunity for min() kernel test robot
2022-02-27 19:44 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-26 12:02 drivers/w1/slaves/w1_therm.c:1452:18-19: WARNING opportunity for max() kernel test robot
2022-02-26 11:57 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24 21:43 drivers/tty/goldfish.c:95:12-13: WARNING opportunity for min() kernel test robot
2022-02-24 21:33 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24  6:58 drivers/dma/dmatest.c:1033:23-24: WARNING opportunity for max() kernel test robot
2022-02-24  6:55 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-24  5:56 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
2022-02-24  5:49 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-23 13:09 kernel/irq/affinity.c:399:12-13: WARNING opportunity for min() kernel test robot
2022-02-23 13:07 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-22 19:56 drivers/gpu/drm/drm_bufs.c:740:33-34: WARNING opportunity for max() kernel test robot
2022-02-22 19:51 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-22 19:51 ` kernel test robot
2022-02-16 16:21 drivers/thunderbolt/property.c:501:12-13: WARNING opportunity for min() kernel test robot
2022-02-16 16:13 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-16 13:26 drivers/acpi/device_pm.c:661:15-16: WARNING opportunity for max() kernel test robot
2022-02-16 13:22 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-15  7:36 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-15  7:32 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-14  3:48 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-14  3:45 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-13  6:36 sound/core/pcm_lib.c:77:35-36: WARNING opportunity for max() kernel test robot
2022-02-13  6:26 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12 10:39 drivers/video/fbdev/core/fbcon.c:605:16-17: WARNING opportunity for min() kernel test robot
2022-02-12 10:04 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12  2:49 drivers/spi/spi-dw-dma.c:85:26-27: WARNING opportunity for max() kernel test robot
2022-02-12  2:43 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-12  2:29 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-12  2:27 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-10  1:21 sound/pci/hda/hda_codec.c:337:19-20: WARNING opportunity for min() kernel test robot
2022-02-10  1:20 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-10  0:10 drivers/md/dm-raid.c:3218:44-45: WARNING opportunity for min() kernel test robot
2022-02-10  0:05 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-09  4:09 drivers/usb/host/xhci-mem.c:436:27-28: WARNING opportunity for max() kernel test robot
2022-02-09  4:07 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2022-02-08 21:58 arch/powerpc/kernel/sysfs.c:456:36-37: WARNING opportunity for max() kernel test robot
2022-02-08 21:54 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-22 17:05 [jlawall:for-5.14 1/8] fs/notify/inotify/inotify_user.c:384:12-13: WARNING opportunity for min() kernel test robot
2021-05-22 17:05 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-02  1:01 [jlawall:for-5.12 1/6] drivers/scsi/hpsa.c:2668:28-29: WARNING opportunity for min() kernel test robot
2021-05-02  1:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-05-02  1:01 ` kernel test robot
2021-05-01 23:01 [jlawall:for-5.12 1/6] drivers/scsi/advansys.c:7734:45-46: WARNING opportunity for min() kernel test robot
2021-05-01 23:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-29 18:06 [jlawall:for-5.12 1/5] arch/arm64/kernel/cpufeature.c:705:12-13: WARNING opportunity for max() kernel test robot
2021-04-29 18:06 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-24  1:50 [jlawall:for-5.12 1/5] drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:186:12-13: WARNING opportunity for min() kernel test robot
2021-04-24  1:50 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-24  1:32 [jlawall:for-5.12 1/5] drivers/ata/libata-scsi.c:3594:10-11: WARNING opportunity for min() kernel test robot
2021-04-24  1:32 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-04-06 13:17 [jlawall:for-5.12 1/4] fs/notify/inotify/inotify_user.c:385:12-13: WARNING opportunity for min() kernel test robot
2021-04-06 13:17 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
2021-03-26 18:37 [jlawall:for-5.12 1/3] net/ipv6/sit.c:328:19-20: WARNING opportunity for min() kernel test robot
2021-03-26 18:37 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220211175824.GA26682@af9116151f38 \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.