* drivers/input/joystick/adi.c:395:13-14: WARNING opportunity for min()
@ 2022-03-31 8:33 kernel test robot
2022-03-31 8:30 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-03-31 8:33 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
date: 11 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 11 months ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220331/202203311613.ig9rkBJl-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/input/joystick/adi.c:395:13-14: WARNING opportunity for min()
Please review and possibly fold the followup patch.
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: misc: fix minmax.cocci warnings
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 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-03-31 8:30 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1658 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: linux-input(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/input/joystick/adi.c:395:13-14: 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: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 10 hours ago
:::::: commit date: 11 months ago
Please take the patch only if it's a positive warning. Thanks!
drivers/input/joystick/adi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/joystick/adi.c
+++ b/drivers/input/joystick/adi.c
@@ -392,7 +392,7 @@ static int adi_init_input(struct adi *ad
if (!input_dev)
return -ENOMEM;
- t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
+ t = min(adi->id, ADI_ID_MAX);
snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id);
snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, adi->cname);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-31 8:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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.