* [sashal-linux-stable:queue-4.14 107/181] drivers/infiniband/hw/cxgb4/cq.c:910:10: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct ib_cq
@ 2020-12-28 14:07 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-28 14:07 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 6869 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.14
head: 59d9df4cd85c6ec97b1b90bbbd0e8004bc23a8f0
commit: eabe95d9a3ed13daaeb8a63a79ec8f4d74ecbe89 [107/181] RDMA/cxgb4: Validate the number of CQEs
config: x86_64-randconfig-a014-20201227 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=eabe95d9a3ed13daaeb8a63a79ec8f4d74ecbe89
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable queue-4.14
git checkout eabe95d9a3ed13daaeb8a63a79ec8f4d74ecbe89
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/infiniband/hw/cxgb4/cq.c:156:48: warning: implicit conversion from enumeration type 'enum t4_bar2_qtype' to different enumeration type 'enum cxgb4_bar2_qtype' [-Wenum-conversion]
cq->bar2_va = c4iw_bar2_addrs(rdev, cq->cqid, T4_BAR2_QTYPE_INGRESS,
~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
>> drivers/infiniband/hw/cxgb4/cq.c:910:10: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct ib_cq *' [-Wint-conversion]
return -EINVAL;
^~~~~~~
2 warnings generated.
vim +910 drivers/infiniband/hw/cxgb4/cq.c
887
888 struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
889 const struct ib_cq_init_attr *attr,
890 struct ib_ucontext *ib_context,
891 struct ib_udata *udata)
892 {
893 int entries = attr->cqe;
894 int vector = attr->comp_vector;
895 struct c4iw_dev *rhp;
896 struct c4iw_cq *chp;
897 struct c4iw_create_cq_resp uresp;
898 struct c4iw_ucontext *ucontext = NULL;
899 int ret, wr_len;
900 size_t memsize, hwentries;
901 struct c4iw_mm_entry *mm, *mm2;
902
903 pr_debug("%s ib_dev %p entries %d\n", __func__, ibdev, entries);
904 if (attr->flags)
905 return ERR_PTR(-EINVAL);
906
907 rhp = to_c4iw_dev(ibdev);
908
909 if (entries < 1 || entries > ibdev->attrs.max_cqe)
> 910 return -EINVAL;
911
912 if (vector >= rhp->rdev.lldi.nciq)
913 return ERR_PTR(-EINVAL);
914
915 chp = kzalloc(sizeof(*chp), GFP_KERNEL);
916 if (!chp)
917 return ERR_PTR(-ENOMEM);
918
919 wr_len = sizeof(struct fw_ri_res_wr) + sizeof(struct fw_ri_res);
920 chp->destroy_skb = alloc_skb(wr_len, GFP_KERNEL);
921 if (!chp->destroy_skb) {
922 ret = -ENOMEM;
923 goto err1;
924 }
925
926 if (ib_context)
927 ucontext = to_c4iw_ucontext(ib_context);
928
929 /* account for the status page. */
930 entries++;
931
932 /* IQ needs one extra entry to differentiate full vs empty. */
933 entries++;
934
935 /*
936 * entries must be multiple of 16 for HW.
937 */
938 entries = roundup(entries, 16);
939
940 /*
941 * Make actual HW queue 2x to avoid cdix_inc overflows.
942 */
943 hwentries = min(entries * 2, rhp->rdev.hw_queue.t4_max_iq_size);
944
945 /*
946 * Make HW queue at least 64 entries so GTS updates aren't too
947 * frequent.
948 */
949 if (hwentries < 64)
950 hwentries = 64;
951
952 memsize = hwentries * sizeof *chp->cq.queue;
953
954 /*
955 * memsize must be a multiple of the page size if its a user cq.
956 */
957 if (ucontext)
958 memsize = roundup(memsize, PAGE_SIZE);
959 chp->cq.size = hwentries;
960 chp->cq.memsize = memsize;
961 chp->cq.vector = vector;
962
963 ret = create_cq(&rhp->rdev, &chp->cq,
964 ucontext ? &ucontext->uctx : &rhp->rdev.uctx);
965 if (ret)
966 goto err2;
967
968 chp->rhp = rhp;
969 chp->cq.size--; /* status page */
970 chp->ibcq.cqe = entries - 2;
971 spin_lock_init(&chp->lock);
972 spin_lock_init(&chp->comp_handler_lock);
973 atomic_set(&chp->refcnt, 1);
974 init_waitqueue_head(&chp->wait);
975 ret = insert_handle(rhp, &rhp->cqidr, chp, chp->cq.cqid);
976 if (ret)
977 goto err3;
978
979 if (ucontext) {
980 ret = -ENOMEM;
981 mm = kmalloc(sizeof *mm, GFP_KERNEL);
982 if (!mm)
983 goto err4;
984 mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
985 if (!mm2)
986 goto err5;
987
988 uresp.qid_mask = rhp->rdev.cqmask;
989 uresp.cqid = chp->cq.cqid;
990 uresp.size = chp->cq.size;
991 uresp.memsize = chp->cq.memsize;
992 spin_lock(&ucontext->mmap_lock);
993 uresp.key = ucontext->key;
994 ucontext->key += PAGE_SIZE;
995 uresp.gts_key = ucontext->key;
996 ucontext->key += PAGE_SIZE;
997 spin_unlock(&ucontext->mmap_lock);
998 ret = ib_copy_to_udata(udata, &uresp,
999 sizeof(uresp) - sizeof(uresp.reserved));
1000 if (ret)
1001 goto err6;
1002
1003 mm->key = uresp.key;
1004 mm->addr = virt_to_phys(chp->cq.queue);
1005 mm->len = chp->cq.memsize;
1006 insert_mmap(ucontext, mm);
1007
1008 mm2->key = uresp.gts_key;
1009 mm2->addr = chp->cq.bar2_pa;
1010 mm2->len = PAGE_SIZE;
1011 insert_mmap(ucontext, mm2);
1012 }
1013 pr_debug("%s cqid 0x%0x chp %p size %u memsize %zu, dma_addr 0x%0llx\n",
1014 __func__, chp->cq.cqid, chp, chp->cq.size,
1015 chp->cq.memsize, (unsigned long long)chp->cq.dma_addr);
1016 return &chp->ibcq;
1017 err6:
1018 kfree(mm2);
1019 err5:
1020 kfree(mm);
1021 err4:
1022 remove_handle(rhp, &rhp->cqidr, chp->cq.cqid);
1023 err3:
1024 destroy_cq(&chp->rhp->rdev, &chp->cq,
1025 ucontext ? &ucontext->uctx : &rhp->rdev.uctx,
1026 chp->destroy_skb);
1027 err2:
1028 kfree_skb(chp->destroy_skb);
1029 err1:
1030 kfree(chp);
1031 return ERR_PTR(ret);
1032 }
1033
---
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: 33958 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-28 14:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 14:07 [sashal-linux-stable:queue-4.14 107/181] drivers/infiniband/hw/cxgb4/cq.c:910:10: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'struct ib_cq 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.