drivers/infiniband/hw/ocrdma/ocrdma.h:499:21: sparse: sparse: cast to restricted __le32
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e6251ab4551f51fa4cee03523e08051898c3ce82
commit: d991bb1c8da842a2a0b9dc83b1005e655783f861 include/linux/compiler-gcc.h: sparse can do constant folding of __builtin_bswap*()
date: 10 months ago
config: mips-randconfig-s031-20220209 (https://download.01.org/0day-ci/archive/20220209/202202091914.WouzjlIJ-lk...)
compiler: mips64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d991bb1c8da842a2a0b9dc83b1005e655783f861
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash drivers/infiniband/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:831:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] pa_lo @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:831:28: sparse: expected unsigned int [usertype] pa_lo
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:831:28: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:832:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] pa_hi @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:832:28: sparse: expected unsigned int [usertype] pa_hi
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:832:28: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:1632:44: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2072:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] pa_lo @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2072:28: sparse: expected unsigned int [usertype] pa_lo
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2072:28: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2073:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] pa_hi @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2073:28: sparse: expected unsigned int [usertype] pa_hi
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2073:28: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2421:18: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2452:44: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2452:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2452:42: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2452:42: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2455:44: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2455:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2455:42: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2455:42: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2461:52: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2461:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2461:50: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2461:50: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2464:52: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2464:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2464:50: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2464:50: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2469:52: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2469:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2469:50: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2469:50: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2472:52: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2472:50: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] flags_status_srcqpn @@ got restricted __le32 [usertype] @@
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2472:50: sparse: expected unsigned int [usertype] flags_status_srcqpn
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2472:50: sparse: got restricted __le32 [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2528:23: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2583:20: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2598:19: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2614:19: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2616:24: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2620:27: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2625:29: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2644:20: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2703:34: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2706:37: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2710:37: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2713:44: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2732:27: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2736:27: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:2780:24: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: note: in included file:
>> drivers/infiniband/hw/ocrdma/ocrdma.h:499:21: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma.h:505:17: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: note: in included file:
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 @@
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: expected unsigned int [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: got restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __le32 @@
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: expected unsigned int [usertype]
drivers/infiniband/hw/ocrdma/ocrdma_hw.h:55:32: sparse: got restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c: note: in included file:
drivers/infiniband/hw/ocrdma/ocrdma.h:505:17: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma.h:517:17: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma.h:523:17: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma.h:511:17: sparse: sparse: cast to restricted __le32
>> drivers/infiniband/hw/ocrdma/ocrdma.h:499:21: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/ocrdma/ocrdma.h:505:17: sparse: sparse: cast to restricted __le32
vim +499 drivers/infiniband/hw/ocrdma/ocrdma.h
fe2caefcdf5869 Parav Pandit 2012-03-21 495
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 496 static inline int is_cqe_valid(struct ocrdma_cq *cq, struct ocrdma_cqe *cqe)
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 497 {
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 498 int cqe_valid;
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 @499 cqe_valid = le32_to_cpu(cqe->flags_status_srcqpn) & OCRDMA_CQE_VALID;
f99b1649dbb634 Naresh Gottumukkala 2013-08-07 500 return (cqe_valid == cq->phase);
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 501 }
df176ea0743fd0 Naresh Gottumukkala 2013-06-10 502
:::::: The code at line 499 was first introduced by commit
:::::: df176ea0743fd0fb0514c862797f6bd8c08ab42e RDMA/ocrdma: Change macros to inline funtions
:::::: TO: Naresh Gottumukkala <bgottumukkala(a)emulex.com>
:::::: CC: Roland Dreier <roland(a)purestorage.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[PATCH] usb: xhci: fix minmax.cocci warnings
by Julia Lawall
From: kernel test robot <lkp(a)intel.com>
Simplify the code using max().
Generated by: scripts/coccinelle/misc/minmax.cocci
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: Julia Lawall <julia.lawall(a)inria.fr>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e6251ab4551f51fa4cee03523e08051898c3ce82
commit: 5f66f73b9ff4dcabd4e2405ba9c32e80e02f9408 coccinelle: misc: add minmax script
:::::: branch date: 8 hours ago
:::::: commit date: 9 months ago
xhci-mem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -433,8 +433,7 @@ int xhci_ring_expansion(struct xhci_hcd
(TRBS_PER_SEGMENT - 1);
/* Allocate number of segments we needed, or double the ring size */
- num_segs = ring->num_segs > num_segs_needed ?
- ring->num_segs : num_segs_needed;
+ num_segs = max(ring->num_segs, num_segs_needed);
ret = xhci_alloc_segments_for_ring(xhci, &first, &last,
num_segs, ring->cycle_state, ring->type,
7 months, 1 week
[xilinx-xlnx:xlnx_rebase_v5.15 400/872] drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test, possible model on line 345 (fwd)
by Julia Lawall
Hello,
Please check line 342, which seems to be missing an [i].
julia
---------- Forwarded message ----------
Date: Wed, 9 Feb 2022 17:21:42 +0800
From: kernel test robot <lkp(a)intel.com>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <julia.lawall(a)lip6.fr>
Subject: [xilinx-xlnx:xlnx_rebase_v5.15 400/872]
drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test,
possible model on line 345
CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Quanyang Wang <quanyang.wang(a)windriver.com>
CC: Michal Simek <monstr(a)monstr.eu>
CC: Manish Narani <manish.narani(a)xilinx.com>
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head: 1183ce490adb103e5e569b8ebd74c50c885ddc05
commit: 52817ef9c056b35660cd1fd8cd02c3d3603c8059 [400/872] Revert "usb: function: f_tcm: Add support for getting alt interface number"
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: i386-randconfig-c021 (https://download.01.org/0day-ci/archive/20220209/202202091733.OwkhhpPA-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
cocci warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test, possible model on line 345
vim +340 drivers/usb/gadget/function/f_tcm.c
c6628548acf083 Rajnikant Bhojani 2022-01-26 331
c6628548acf083 Rajnikant Bhojani 2022-01-26 332 static int alloc_cmd_resource(struct f_uas *fu, int num, struct usb_ep *ep,
c6628548acf083 Rajnikant Bhojani 2022-01-26 333 void (*complete)(struct usb_ep *ep,
c6628548acf083 Rajnikant Bhojani 2022-01-26 334 struct usb_request *req))
c6628548acf083 Rajnikant Bhojani 2022-01-26 335 {
c6628548acf083 Rajnikant Bhojani 2022-01-26 336 int i;
c6628548acf083 Rajnikant Bhojani 2022-01-26 337
c6628548acf083 Rajnikant Bhojani 2022-01-26 338 fu->ncmd = num;
c6628548acf083 Rajnikant Bhojani 2022-01-26 339 for (i = 0; i < fu->ncmd; i++) {
c6628548acf083 Rajnikant Bhojani 2022-01-26 @340 fu->cmd[i] = kcalloc(fu->ncmd, sizeof(struct usbg_cdb),
c6628548acf083 Rajnikant Bhojani 2022-01-26 341 GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26 342 if (!fu->cmd)
c6628548acf083 Rajnikant Bhojani 2022-01-26 343 goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26 344
c6628548acf083 Rajnikant Bhojani 2022-01-26 @345 fu->cmd[i]->req = usb_ep_alloc_request(ep, GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26 346 if (!fu->cmd[i]->req)
c6628548acf083 Rajnikant Bhojani 2022-01-26 347 goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26 348
c6628548acf083 Rajnikant Bhojani 2022-01-26 349 fu->cmd[i]->buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26 350 if (!fu->cmd[i]->buf)
c6628548acf083 Rajnikant Bhojani 2022-01-26 351 goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26 352
c6628548acf083 Rajnikant Bhojani 2022-01-26 353 fu->cmd[i]->req->complete = complete;
c6628548acf083 Rajnikant Bhojani 2022-01-26 354 fu->cmd[i]->req->buf = fu->cmd[i]->buf;
c6628548acf083 Rajnikant Bhojani 2022-01-26 355 fu->cmd[i]->req->length = fu->ep_out->maxpacket;
c6628548acf083 Rajnikant Bhojani 2022-01-26 356 fu->cmd[i]->req->context = fu;
c6628548acf083 Rajnikant Bhojani 2022-01-26 357 }
c6628548acf083 Rajnikant Bhojani 2022-01-26 358
c6628548acf083 Rajnikant Bhojani 2022-01-26 359 return 0;
c6628548acf083 Rajnikant Bhojani 2022-01-26 360 err_cmd:
c6628548acf083 Rajnikant Bhojani 2022-01-26 361 free_cmd_resource(fu, ep);
c6628548acf083 Rajnikant Bhojani 2022-01-26 362 return -ENOMEM;
c6628548acf083 Rajnikant Bhojani 2022-01-26 363 }
c6628548acf083 Rajnikant Bhojani 2022-01-26 364
:::::: The code at line 340 was first introduced by commit
:::::: c6628548acf08392524df4bdbeee080f6f5ecc43 usb: gadget: f_tcm: queue multiple commands request
:::::: TO: Rajnikant Bhojani <rajnikant.bhojani(a)xilinx.com>
:::::: CC: Michal Simek <michal.simek(a)xilinx.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week