drivers/video/fbdev/core/fbcon.c:605:16-17: WARNING opportunity for min()
Subsystems (3)
kernel test robot
build botCC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 83e396641110663d3c7bb25b9bc0c6a750359ecf commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script date: 10 months ago
:::::: branch date: 12 hours ago
:::::: commit date: 10 months ago
config: nds32-randconfig-c003-20220209 (https://download.01.org/0day-ci/archive/20220212/202202121748.vOWEcbGM-lkp(a)intel.com/config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
cocci warnings: (new ones prefixed by >>)
>> drivers/video/fbdev/core/fbcon.c:605:16-17: WARNING opportunity for min() -- >> fs/btrfs/qgroup.c:515:12-13: WARNING opportunity for min() -- >> fs/btrfs/scrub.c:3053:12-13: WARNING opportunity for min() fs/btrfs/scrub.c:3513:12-13: WARNING opportunity for min() -- >> fs/btrfs/volumes.c:7531:13-14: WARNING opportunity for min()
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build bot[PATCH] coccinelle: misc: fix minmax.cocci warnings
CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov <[email protected]> CC: Julia Lawall <[email protected]> CC: "Greg Kroah-Hartman" <[email protected]>…
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <[email protected]>
CC: Julia Lawall <[email protected]>
CC: "Greg Kroah-Hartman" <[email protected]>
CC: Du Cheng <[email protected]>
CC: dri-devel(a)lists.freedesktop.org
CC: linux-fbdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <[email protected]>
drivers/video/fbdev/core/fbcon.c:605:16-17: 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
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 83e396641110663d3c7bb25b9bc0c6a750359ecf commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 12 hours ago
:::::: commit date: 10 months ago
Please take the patch only if it's a positive warning. Thanks!
fbcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/fbcon.c +1 -1
@@ -602,7 +602,7 @@ static void fbcon_prepare_logo(struct vc save =kmalloc (array3_size (logo_lines, new_cols,2 ),GFP_KERNEL );if (save) { -int i = cols < new_cols ? cols : new_cols; +int i =min (cols, new_cols);scr_memsetw (save, erase,array3_size (logo_lines, new_cols,2 )); r = q - step;for (cnt =0 ; cnt < logo_lines; cnt++, r += i)