From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7108722608914221188==" MIME-Version: 1.0 From: Jason Gunthorpe To: kbuild-all@lists.01.org Subject: Re: [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 16:31:48 -0300 Message-ID: <20200929193148.GE9475@nvidia.com> In-Reply-To: <20200929192441.GC18329@kadam> List-Id: --===============7108722608914221188== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Sep 29, 2020 at 10:24:41PM +0300, Dan Carpenter wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.g= it rdma-next > head: 41142fada89c77281000029c8f4ce28ea8ed95ac > commit: b287f59569b5ddead80547afb3fbe54ba19d71a2 [67/71] RDMA/mlx5: Use m= lx5_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=3Db287f59569b5ddead80547afb3fbe54ba19d71a2 = > git remote add leon-rdma https://git.kernel.org/pub/scm/linux/ker= nel/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=3D1 C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' AR= CH=3Di386 = > = > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > = > 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_cr= eate_wq *ucmd) > 79b20a6c3014c7 Yishai Hadas 2016-05-23 833 { > 89944450547334 Shamir Rabinovitch 2019-02-07 834 struct mlx5_ib_uconte= xt *ucontext =3D rdma_udata_to_drv_context( > 89944450547334 Shamir Rabinovitch 2019-02-07 835 udata, struct mlx5_i= b_ucontext, ibucontext); > b287f59569b5dd Jason Gunthorpe 2020-08-21 836 unsigned long page_si= ze =3D 0; > 79b20a6c3014c7 Yishai Hadas 2016-05-23 837 u32 offset =3D 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 =3D 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, "um= em_get failed\n"); > 79b20a6c3014c7 Yishai Hadas 2016-05-23 846 err =3D 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 =3D mlx5_um= em_find_best_quantized_pgoff( > b287f59569b5dd Jason Gunthorpe 2020-08-21 851 rwq->umem, wq, log_w= q_pg_sz, MLX5_ADAPTER_PAGE_SHIFT, > b287f59569b5dd Jason Gunthorpe 2020-08-21 852 page_offset, 64, &rw= q->rq_page_offset); > b287f59569b5dd Jason Gunthorpe 2020-08-21 853 if (!page_size) { > 79b20a6c3014c7 Yishai Hadas 2016-05-23 854 mlx5_ib_warn(dev, "b= ad offset\n"); > b287f59569b5dd Jason Gunthorpe 2020-08-21 855 err =3D -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 =3D i= b_umem_num_dma_blocks(rwq->umem, page_size); > b287f59569b5dd Jason Gunthorpe 2020-08-21 860 rwq->page_shift =3D o= rder_base_2(page_size); > b287f59569b5dd Jason Gunthorpe 2020-08-21 @861 rwq->log_page_size = =3D page_shift - page_shift; > = ^^^^^^^^^^^^^^^^^^^^^^^^ > Sharing is caring. #Drugs #NancyReagan Oh neat Should be rwq->log_page_size =3D rwq->page_shift - MLX5_ADAPTER_PAGE_SHIFT; Thanks, Jason --===============7108722608914221188==--