* [linux-next:master 947/1853] drivers/infiniband/hw/erdma/erdma_cm.c:380:12-13: WARNING opportunity for min()
@ 2022-06-08 5:51 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-06-08 5:51 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 3852 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Cheng Xu <chengyou@linux.alibaba.com>
CC: Jason Gunthorpe <jgg@ziepe.ca>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 73d0e32571a0786151eb72634f1a4c5891166176
commit: 5a865a32bf9b449da35956df247b69b78dc55ed1 [947/1853] RDMA/erdma: Add driver to kernel build environment
:::::: branch date: 25 hours ago
:::::: commit date: 2 days ago
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20220608/202206081324.mRLy55qR-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/infiniband/hw/erdma/erdma_cm.c:380:12-13: WARNING opportunity for min()
drivers/infiniband/hw/erdma/erdma_cm.c:1007:12-13: WARNING opportunity for min()
vim +380 drivers/infiniband/hw/erdma/erdma_cm.c
81c527f04b90f47 Cheng Xu 2022-05-23 345
81c527f04b90f47 Cheng Xu 2022-05-23 346 static int erdma_send_mpareqrep(struct erdma_cep *cep, const void *pdata,
81c527f04b90f47 Cheng Xu 2022-05-23 347 u8 pd_len)
81c527f04b90f47 Cheng Xu 2022-05-23 348 {
81c527f04b90f47 Cheng Xu 2022-05-23 349 struct socket *s = cep->sock;
81c527f04b90f47 Cheng Xu 2022-05-23 350 struct mpa_rr *rr = &cep->mpa.hdr;
81c527f04b90f47 Cheng Xu 2022-05-23 351 struct kvec iov[3];
81c527f04b90f47 Cheng Xu 2022-05-23 352 struct msghdr msg;
81c527f04b90f47 Cheng Xu 2022-05-23 353 int iovec_num = 0;
81c527f04b90f47 Cheng Xu 2022-05-23 354 int ret;
81c527f04b90f47 Cheng Xu 2022-05-23 355 int mpa_len;
81c527f04b90f47 Cheng Xu 2022-05-23 356
81c527f04b90f47 Cheng Xu 2022-05-23 357 memset(&msg, 0, sizeof(msg));
81c527f04b90f47 Cheng Xu 2022-05-23 358
81c527f04b90f47 Cheng Xu 2022-05-23 359 rr->params.pd_len = cpu_to_be16(pd_len);
81c527f04b90f47 Cheng Xu 2022-05-23 360
81c527f04b90f47 Cheng Xu 2022-05-23 361 iov[iovec_num].iov_base = rr;
81c527f04b90f47 Cheng Xu 2022-05-23 362 iov[iovec_num].iov_len = sizeof(*rr);
81c527f04b90f47 Cheng Xu 2022-05-23 363 iovec_num++;
81c527f04b90f47 Cheng Xu 2022-05-23 364 mpa_len = sizeof(*rr);
81c527f04b90f47 Cheng Xu 2022-05-23 365
81c527f04b90f47 Cheng Xu 2022-05-23 366 iov[iovec_num].iov_base = &cep->mpa.ext_data;
81c527f04b90f47 Cheng Xu 2022-05-23 367 iov[iovec_num].iov_len = sizeof(cep->mpa.ext_data);
81c527f04b90f47 Cheng Xu 2022-05-23 368 iovec_num++;
81c527f04b90f47 Cheng Xu 2022-05-23 369 mpa_len += sizeof(cep->mpa.ext_data);
81c527f04b90f47 Cheng Xu 2022-05-23 370
81c527f04b90f47 Cheng Xu 2022-05-23 371 if (pd_len) {
81c527f04b90f47 Cheng Xu 2022-05-23 372 iov[iovec_num].iov_base = (char *)pdata;
81c527f04b90f47 Cheng Xu 2022-05-23 373 iov[iovec_num].iov_len = pd_len;
81c527f04b90f47 Cheng Xu 2022-05-23 374 mpa_len += pd_len;
81c527f04b90f47 Cheng Xu 2022-05-23 375 iovec_num++;
81c527f04b90f47 Cheng Xu 2022-05-23 376 }
81c527f04b90f47 Cheng Xu 2022-05-23 377
81c527f04b90f47 Cheng Xu 2022-05-23 378 ret = kernel_sendmsg(s, &msg, iov, iovec_num, mpa_len);
81c527f04b90f47 Cheng Xu 2022-05-23 379
81c527f04b90f47 Cheng Xu 2022-05-23 @380 return ret < 0 ? ret : 0;
81c527f04b90f47 Cheng Xu 2022-05-23 381 }
81c527f04b90f47 Cheng Xu 2022-05-23 382
:::::: The code@line 380 was first introduced by commit
:::::: 81c527f04b90f471b42c1ba28a489ce996dad9b2 RDMA/erdma: Add connection management (CM) support
:::::: TO: Cheng Xu <chengyou@linux.alibaba.com>
:::::: CC: Jason Gunthorpe <jgg@nvidia.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-06-08 5:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 5:51 [linux-next:master 947/1853] drivers/infiniband/hw/erdma/erdma_cm.c:380:12-13: WARNING opportunity for min() 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.