All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
Date: Tue, 29 Sep 2020 22:24:41 +0300	[thread overview]
Message-ID: <20200929192441.GC18329@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git  rdma-next
head:   41142fada89c77281000029c8f4ce28ea8ed95ac
commit: b287f59569b5ddead80547afb3fbe54ba19d71a2 [67/71] RDMA/mlx5: Use mlx5_umem_find_best_quantized_pgoff() for WQ
config: i386-randconfig-s002-20200929 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-201-g24bdaac6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?id=b287f59569b5ddead80547afb3fbe54ba19d71a2 
        git remote add leon-rdma https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git 
        git fetch --no-tags leon-rdma rdma-next
        git checkout b287f59569b5ddead80547afb3fbe54ba19d71a2
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

	echo
	echo "sparse warnings: (new ones prefixed by >>)"
	echo
>> drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of functions? Share your drugs

vim +861 drivers/infiniband/hw/mlx5/qp.c

79b20a6c3014c7 Yishai Hadas       2016-05-23  830  static int create_user_rq(struct mlx5_ib_dev *dev, struct ib_pd *pd,
b0ea0fa5435f9d Jason Gunthorpe    2019-01-09  831  			  struct ib_udata *udata, struct mlx5_ib_rwq *rwq,
79b20a6c3014c7 Yishai Hadas       2016-05-23  832  			  struct mlx5_ib_create_wq *ucmd)
79b20a6c3014c7 Yishai Hadas       2016-05-23  833  {
89944450547334 Shamir Rabinovitch 2019-02-07  834  	struct mlx5_ib_ucontext *ucontext = rdma_udata_to_drv_context(
89944450547334 Shamir Rabinovitch 2019-02-07  835  		udata, struct mlx5_ib_ucontext, ibucontext);
b287f59569b5dd Jason Gunthorpe    2020-08-21  836  	unsigned long page_size = 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  837  	u32 offset = 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  838  	int err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  839  
79b20a6c3014c7 Yishai Hadas       2016-05-23  840  	if (!ucmd->buf_addr)
79b20a6c3014c7 Yishai Hadas       2016-05-23  841  		return -EINVAL;
79b20a6c3014c7 Yishai Hadas       2016-05-23  842  
c320e527e15483 Moni Shoua         2020-01-15  843  	rwq->umem = ib_umem_get(&dev->ib_dev, ucmd->buf_addr, rwq->buf_size, 0);
79b20a6c3014c7 Yishai Hadas       2016-05-23  844  	if (IS_ERR(rwq->umem)) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  845  		mlx5_ib_dbg(dev, "umem_get failed\n");
79b20a6c3014c7 Yishai Hadas       2016-05-23  846  		err = PTR_ERR(rwq->umem);
79b20a6c3014c7 Yishai Hadas       2016-05-23  847  		return err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  848  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  849  
b287f59569b5dd Jason Gunthorpe    2020-08-21  850  	page_size = mlx5_umem_find_best_quantized_pgoff(
b287f59569b5dd Jason Gunthorpe    2020-08-21  851  		rwq->umem, wq, log_wq_pg_sz, MLX5_ADAPTER_PAGE_SHIFT,
b287f59569b5dd Jason Gunthorpe    2020-08-21  852  		page_offset, 64, &rwq->rq_page_offset);
b287f59569b5dd Jason Gunthorpe    2020-08-21  853  	if (!page_size) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  854  		mlx5_ib_warn(dev, "bad offset\n");
b287f59569b5dd Jason Gunthorpe    2020-08-21  855  		err = -EINVAL;
79b20a6c3014c7 Yishai Hadas       2016-05-23  856  		goto err_umem;
79b20a6c3014c7 Yishai Hadas       2016-05-23  857  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  858  
b287f59569b5dd Jason Gunthorpe    2020-08-21  859  	rwq->rq_num_pas = ib_umem_num_dma_blocks(rwq->umem, page_size);
b287f59569b5dd Jason Gunthorpe    2020-08-21  860  	rwq->page_shift = order_base_2(page_size);
b287f59569b5dd Jason Gunthorpe    2020-08-21 @861  	rwq->log_page_size =  page_shift - page_shift;
                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^
Sharing is caring.  #Drugs #NancyReagan

79b20a6c3014c7 Yishai Hadas       2016-05-23  862  	rwq->wq_sig = !!(ucmd->flags & MLX5_WQ_FLAG_SIGNATURE);
79b20a6c3014c7 Yishai Hadas       2016-05-23  863  
97cb748d1478c1 Jason Gunthorpe    2020-08-19  864  	mlx5_ib_dbg(
97cb748d1478c1 Jason Gunthorpe    2020-08-19  865  		dev,
b287f59569b5dd Jason Gunthorpe    2020-08-21  866  		"addr 0x%llx, size %zd, npages %zu, page_size %ld, ncont %d, offset %d\n",
79b20a6c3014c7 Yishai Hadas       2016-05-23  867  		(unsigned long long)ucmd->buf_addr, rwq->buf_size,
b287f59569b5dd Jason Gunthorpe    2020-08-21  868  		ib_umem_num_pages(rwq->umem), page_size, rwq->rq_num_pas,
97cb748d1478c1 Jason Gunthorpe    2020-08-19  869  		offset);
79b20a6c3014c7 Yishai Hadas       2016-05-23  870  
89944450547334 Shamir Rabinovitch 2019-02-07  871  	err = mlx5_ib_db_map_user(ucontext, udata, ucmd->db_addr, &rwq->db);
79b20a6c3014c7 Yishai Hadas       2016-05-23  872  	if (err) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  873  		mlx5_ib_dbg(dev, "map failed\n");
79b20a6c3014c7 Yishai Hadas       2016-05-23  874  		goto err_umem;
79b20a6c3014c7 Yishai Hadas       2016-05-23  875  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  876  
79b20a6c3014c7 Yishai Hadas       2016-05-23  877  	return 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  878  
79b20a6c3014c7 Yishai Hadas       2016-05-23  879  err_umem:
79b20a6c3014c7 Yishai Hadas       2016-05-23  880  	ib_umem_release(rwq->umem);
79b20a6c3014c7 Yishai Hadas       2016-05-23  881  	return err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  882  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39138 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [kbuild] [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs
Date: Tue, 29 Sep 2020 22:24:41 +0300	[thread overview]
Message-ID: <20200929192441.GC18329@kadam> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git  rdma-next
head:   41142fada89c77281000029c8f4ce28ea8ed95ac
commit: b287f59569b5ddead80547afb3fbe54ba19d71a2 [67/71] RDMA/mlx5: Use mlx5_umem_find_best_quantized_pgoff() for WQ
config: i386-randconfig-s002-20200929 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-201-g24bdaac6-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commit/?id=b287f59569b5ddead80547afb3fbe54ba19d71a2 
        git remote add leon-rdma https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git 
        git fetch --no-tags leon-rdma rdma-next
        git checkout b287f59569b5ddead80547afb3fbe54ba19d71a2
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

	echo
	echo "sparse warnings: (new ones prefixed by >>)"
	echo
>> drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of functions? Share your drugs

vim +861 drivers/infiniband/hw/mlx5/qp.c

79b20a6c3014c7 Yishai Hadas       2016-05-23  830  static int create_user_rq(struct mlx5_ib_dev *dev, struct ib_pd *pd,
b0ea0fa5435f9d Jason Gunthorpe    2019-01-09  831  			  struct ib_udata *udata, struct mlx5_ib_rwq *rwq,
79b20a6c3014c7 Yishai Hadas       2016-05-23  832  			  struct mlx5_ib_create_wq *ucmd)
79b20a6c3014c7 Yishai Hadas       2016-05-23  833  {
89944450547334 Shamir Rabinovitch 2019-02-07  834  	struct mlx5_ib_ucontext *ucontext = rdma_udata_to_drv_context(
89944450547334 Shamir Rabinovitch 2019-02-07  835  		udata, struct mlx5_ib_ucontext, ibucontext);
b287f59569b5dd Jason Gunthorpe    2020-08-21  836  	unsigned long page_size = 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  837  	u32 offset = 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  838  	int err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  839  
79b20a6c3014c7 Yishai Hadas       2016-05-23  840  	if (!ucmd->buf_addr)
79b20a6c3014c7 Yishai Hadas       2016-05-23  841  		return -EINVAL;
79b20a6c3014c7 Yishai Hadas       2016-05-23  842  
c320e527e15483 Moni Shoua         2020-01-15  843  	rwq->umem = ib_umem_get(&dev->ib_dev, ucmd->buf_addr, rwq->buf_size, 0);
79b20a6c3014c7 Yishai Hadas       2016-05-23  844  	if (IS_ERR(rwq->umem)) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  845  		mlx5_ib_dbg(dev, "umem_get failed\n");
79b20a6c3014c7 Yishai Hadas       2016-05-23  846  		err = PTR_ERR(rwq->umem);
79b20a6c3014c7 Yishai Hadas       2016-05-23  847  		return err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  848  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  849  
b287f59569b5dd Jason Gunthorpe    2020-08-21  850  	page_size = mlx5_umem_find_best_quantized_pgoff(
b287f59569b5dd Jason Gunthorpe    2020-08-21  851  		rwq->umem, wq, log_wq_pg_sz, MLX5_ADAPTER_PAGE_SHIFT,
b287f59569b5dd Jason Gunthorpe    2020-08-21  852  		page_offset, 64, &rwq->rq_page_offset);
b287f59569b5dd Jason Gunthorpe    2020-08-21  853  	if (!page_size) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  854  		mlx5_ib_warn(dev, "bad offset\n");
b287f59569b5dd Jason Gunthorpe    2020-08-21  855  		err = -EINVAL;
79b20a6c3014c7 Yishai Hadas       2016-05-23  856  		goto err_umem;
79b20a6c3014c7 Yishai Hadas       2016-05-23  857  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  858  
b287f59569b5dd Jason Gunthorpe    2020-08-21  859  	rwq->rq_num_pas = ib_umem_num_dma_blocks(rwq->umem, page_size);
b287f59569b5dd Jason Gunthorpe    2020-08-21  860  	rwq->page_shift = order_base_2(page_size);
b287f59569b5dd Jason Gunthorpe    2020-08-21 @861  	rwq->log_page_size =  page_shift - page_shift;
                                                                              ^^^^^^^^^^^^^^^^^^^^^^^^
Sharing is caring.  #Drugs #NancyReagan

79b20a6c3014c7 Yishai Hadas       2016-05-23  862  	rwq->wq_sig = !!(ucmd->flags & MLX5_WQ_FLAG_SIGNATURE);
79b20a6c3014c7 Yishai Hadas       2016-05-23  863  
97cb748d1478c1 Jason Gunthorpe    2020-08-19  864  	mlx5_ib_dbg(
97cb748d1478c1 Jason Gunthorpe    2020-08-19  865  		dev,
b287f59569b5dd Jason Gunthorpe    2020-08-21  866  		"addr 0x%llx, size %zd, npages %zu, page_size %ld, ncont %d, offset %d\n",
79b20a6c3014c7 Yishai Hadas       2016-05-23  867  		(unsigned long long)ucmd->buf_addr, rwq->buf_size,
b287f59569b5dd Jason Gunthorpe    2020-08-21  868  		ib_umem_num_pages(rwq->umem), page_size, rwq->rq_num_pas,
97cb748d1478c1 Jason Gunthorpe    2020-08-19  869  		offset);
79b20a6c3014c7 Yishai Hadas       2016-05-23  870  
89944450547334 Shamir Rabinovitch 2019-02-07  871  	err = mlx5_ib_db_map_user(ucontext, udata, ucmd->db_addr, &rwq->db);
79b20a6c3014c7 Yishai Hadas       2016-05-23  872  	if (err) {
79b20a6c3014c7 Yishai Hadas       2016-05-23  873  		mlx5_ib_dbg(dev, "map failed\n");
79b20a6c3014c7 Yishai Hadas       2016-05-23  874  		goto err_umem;
79b20a6c3014c7 Yishai Hadas       2016-05-23  875  	}
79b20a6c3014c7 Yishai Hadas       2016-05-23  876  
79b20a6c3014c7 Yishai Hadas       2016-05-23  877  	return 0;
79b20a6c3014c7 Yishai Hadas       2016-05-23  878  
79b20a6c3014c7 Yishai Hadas       2016-05-23  879  err_umem:
79b20a6c3014c7 Yishai Hadas       2016-05-23  880  	ib_umem_release(rwq->umem);
79b20a6c3014c7 Yishai Hadas       2016-05-23  881  	return err;
79b20a6c3014c7 Yishai Hadas       2016-05-23  882  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org 

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 39138 bytes --]

             reply	other threads:[~2020-09-29 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 19:24 Dan Carpenter [this message]
2020-09-29 19:24 ` [kbuild] [leon-rdma:rdma-next 67/71] drivers/infiniband/hw/mlx5/qp.c:861:42: sparse: sparse: subtraction of Share your drugs Dan Carpenter
2020-09-29 19:31 ` Jason Gunthorpe
  -- strict thread matches above, loose matches on Subject: below --
2020-09-30  5:26 kernel test robot
2020-09-29 19:19 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200929192441.GC18329@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.