All of lore.kernel.org
 help / color / mirror / Atom feed
* [sashal-linux-stable:queue-4.9 77/128] drivers/infiniband/hw/cxgb4/cq.c:897:10: warning: return makes pointer from integer without a cast
@ 2020-12-27 19:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-27 19:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6049 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.9
head:   72260bd4999b1a400ace77f186ded8429ce02bbc
commit: 9f43ba4aad20b2f53352083143bb22aee0b190b0 [77/128] RDMA/cxgb4: Validate the number of CQEs
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/commit/?id=9f43ba4aad20b2f53352083143bb22aee0b190b0
        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.9
        git checkout 9f43ba4aad20b2f53352083143bb22aee0b190b0
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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: In function 'c4iw_create_cq':
>> drivers/infiniband/hw/cxgb4/cq.c:897:10: warning: return makes pointer from integer without a cast [-Wint-conversion]
      return -EINVAL;
             ^


vim +897 drivers/infiniband/hw/cxgb4/cq.c

   874	
   875	struct ib_cq *c4iw_create_cq(struct ib_device *ibdev,
   876				     const struct ib_cq_init_attr *attr,
   877				     struct ib_ucontext *ib_context,
   878				     struct ib_udata *udata)
   879	{
   880		int entries = attr->cqe;
   881		int vector = attr->comp_vector;
   882		struct c4iw_dev *rhp;
   883		struct c4iw_cq *chp;
   884		struct c4iw_create_cq_resp uresp;
   885		struct c4iw_ucontext *ucontext = NULL;
   886		int ret, wr_len;
   887		size_t memsize, hwentries;
   888		struct c4iw_mm_entry *mm, *mm2;
   889	
   890		PDBG("%s ib_dev %p entries %d\n", __func__, ibdev, entries);
   891		if (attr->flags)
   892			return ERR_PTR(-EINVAL);
   893	
   894		rhp = to_c4iw_dev(ibdev);
   895	
   896		if (entries < 1 || entries > ibdev->attrs.max_cqe)
 > 897			return -EINVAL;
   898	
   899		if (vector >= rhp->rdev.lldi.nciq)
   900			return ERR_PTR(-EINVAL);
   901	
   902		chp = kzalloc(sizeof(*chp), GFP_KERNEL);
   903		if (!chp)
   904			return ERR_PTR(-ENOMEM);
   905	
   906		wr_len = sizeof(struct fw_ri_res_wr) + sizeof(struct fw_ri_res);
   907		chp->destroy_skb = alloc_skb(wr_len, GFP_KERNEL);
   908		if (!chp->destroy_skb) {
   909			ret = -ENOMEM;
   910			goto err1;
   911		}
   912	
   913		if (ib_context)
   914			ucontext = to_c4iw_ucontext(ib_context);
   915	
   916		/* account for the status page. */
   917		entries++;
   918	
   919		/* IQ needs one extra entry to differentiate full vs empty. */
   920		entries++;
   921	
   922		/*
   923		 * entries must be multiple of 16 for HW.
   924		 */
   925		entries = roundup(entries, 16);
   926	
   927		/*
   928		 * Make actual HW queue 2x to avoid cdix_inc overflows.
   929		 */
   930		hwentries = min(entries * 2, rhp->rdev.hw_queue.t4_max_iq_size);
   931	
   932		/*
   933		 * Make HW queue at least 64 entries so GTS updates aren't too
   934		 * frequent.
   935		 */
   936		if (hwentries < 64)
   937			hwentries = 64;
   938	
   939		memsize = hwentries * sizeof *chp->cq.queue;
   940	
   941		/*
   942		 * memsize must be a multiple of the page size if its a user cq.
   943		 */
   944		if (ucontext)
   945			memsize = roundup(memsize, PAGE_SIZE);
   946		chp->cq.size = hwentries;
   947		chp->cq.memsize = memsize;
   948		chp->cq.vector = vector;
   949	
   950		ret = create_cq(&rhp->rdev, &chp->cq,
   951				ucontext ? &ucontext->uctx : &rhp->rdev.uctx);
   952		if (ret)
   953			goto err2;
   954	
   955		chp->rhp = rhp;
   956		chp->cq.size--;				/* status page */
   957		chp->ibcq.cqe = entries - 2;
   958		spin_lock_init(&chp->lock);
   959		spin_lock_init(&chp->comp_handler_lock);
   960		atomic_set(&chp->refcnt, 1);
   961		init_waitqueue_head(&chp->wait);
   962		ret = insert_handle(rhp, &rhp->cqidr, chp, chp->cq.cqid);
   963		if (ret)
   964			goto err3;
   965	
   966		if (ucontext) {
   967			mm = kmalloc(sizeof *mm, GFP_KERNEL);
   968			if (!mm)
   969				goto err4;
   970			mm2 = kmalloc(sizeof *mm2, GFP_KERNEL);
   971			if (!mm2)
   972				goto err5;
   973	
   974			uresp.qid_mask = rhp->rdev.cqmask;
   975			uresp.cqid = chp->cq.cqid;
   976			uresp.size = chp->cq.size;
   977			uresp.memsize = chp->cq.memsize;
   978			spin_lock(&ucontext->mmap_lock);
   979			uresp.key = ucontext->key;
   980			ucontext->key += PAGE_SIZE;
   981			uresp.gts_key = ucontext->key;
   982			ucontext->key += PAGE_SIZE;
   983			spin_unlock(&ucontext->mmap_lock);
   984			ret = ib_copy_to_udata(udata, &uresp,
   985					       sizeof(uresp) - sizeof(uresp.reserved));
   986			if (ret)
   987				goto err6;
   988	
   989			mm->key = uresp.key;
   990			mm->addr = virt_to_phys(chp->cq.queue);
   991			mm->len = chp->cq.memsize;
   992			insert_mmap(ucontext, mm);
   993	
   994			mm2->key = uresp.gts_key;
   995			mm2->addr = chp->cq.bar2_pa;
   996			mm2->len = PAGE_SIZE;
   997			insert_mmap(ucontext, mm2);
   998		}
   999		PDBG("%s cqid 0x%0x chp %p size %u memsize %zu, dma_addr 0x%0llx\n",
  1000		     __func__, chp->cq.cqid, chp, chp->cq.size,
  1001		     chp->cq.memsize, (unsigned long long) chp->cq.dma_addr);
  1002		return &chp->ibcq;
  1003	err6:
  1004		kfree(mm2);
  1005	err5:
  1006		kfree(mm);
  1007	err4:
  1008		remove_handle(rhp, &rhp->cqidr, chp->cq.cqid);
  1009	err3:
  1010		destroy_cq(&chp->rhp->rdev, &chp->cq,
  1011			   ucontext ? &ucontext->uctx : &rhp->rdev.uctx,
  1012			   chp->destroy_skb);
  1013	err2:
  1014		kfree_skb(chp->destroy_skb);
  1015	err1:
  1016		kfree(chp);
  1017		return ERR_PTR(ret);
  1018	}
  1019	

---
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: 56106 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-27 19:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-27 19:00 [sashal-linux-stable:queue-4.9 77/128] drivers/infiniband/hw/cxgb4/cq.c:897:10: warning: return makes pointer from integer without a cast 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.