* [jlawall:for-5.12 1/6] drivers/scsi/advansys.c:7734:45-46: WARNING opportunity for min()
@ 2021-05-01 23:01 kernel test robot
2021-05-01 23:01 ` [PATCH] coccinelle: misc: fix minmax.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-05-01 23:01 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 955 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.12
head: afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago
config: arc-randconfig-c023-20210502 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.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/scsi/advansys.c:7734:45-46: 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
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38854 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: misc: fix minmax.cocci warnings
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 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-05-01 23:01 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@inria.fr>
CC: Matthew Wilcox <willy@infradead.org>
CC: Hannes Reinecke <hare@suse.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/scsi/advansys.c:7734:45-46: 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
Fixes: 8636e3295ce3 ("coccinelle: misc: add minmax script")
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/jlawall/linux.git for-5.12
head: afa104b04309a6e882f6797216e74489c0d5534f
commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/6] coccinelle: misc: add minmax script
:::::: branch date: 4 days ago
:::::: commit date: 6 weeks ago
Please take the patch only if it's a positive warning. Thanks!
advansys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -7731,7 +7731,7 @@ adv_build_req(struct asc_board *boardp,
/* Set CDB length and copy it to the request structure. */
scsiqp->cdb_len = scp->cmd_len;
/* Copy first 12 CDB bytes to cdb[]. */
- memcpy(scsiqp->cdb, scp->cmnd, scp->cmd_len < 12 ? scp->cmd_len : 12);
+ memcpy(scsiqp->cdb, scp->cmnd, min(scp->cmd_len, 12));
/* Copy last 4 CDB bytes, if present, to cdb16[]. */
if (scp->cmd_len > 12) {
int cdb16_len = scp->cmd_len - 12;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-01 23:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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.