RE: [linux-next:master 6312/7430] drivers/infiniband/hw/irdma/hw.c:579:44: sparse: sparse: non size-preserving integer to pointer cast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Subject: [linux-next:master 6312/7430] drivers/infiniband/hw/irdma/hw.c:579:44:
> sparse: sparse: non size-preserving integer to pointer cast
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   ccc252d2e818f6a479441119ad453c3ce7c7c461
> commit: fa0cf568fd76550c1ddb806c03a65a1a4a1ea909 [6312/7430] RDMA/irdma:
> Add irdma Kconfig/Makefile and remove i40iw
> config: mips-allyesconfig (attached as .config)
> compiler: mips-linux-gcc (GCC) 9.3.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.3-341-g8af24329-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-
> next.git/commit/?id=fa0cf568fd76550c1ddb806c03a65a1a4a1ea909
>         git remote add linux-next
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout fa0cf568fd76550c1ddb806c03a65a1a4a1ea909
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross
> C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=mips
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> 
> 
> 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/irdma/hw.c:579:44: sparse: sparse: non 
> >> size-preserving integer to pointer cast
> 
> vim +579 drivers/infiniband/hw/irdma/hw.c
> 
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  574
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  575  static void 
> irdma_destroy_virt_aeq(struct irdma_pci_f *rf)
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  576  {
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  577  	struct irdma_aeq *aeq =
> &rf->aeq;
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  578  	u32 pg_cnt =
> DIV_ROUND_UP(aeq->mem.size, PAGE_SIZE);
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02 @579  	dma_addr_t *pg_arr =
> (dma_addr_t *)aeq->palloc.level1.addr;

I think this is because a u64 addr is typecasted to dma_addr_t type ptr which could be of different size based on arch.
I will inspect and send a fix.


> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  580
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  581
> 	irdma_unmap_vm_page_list(&rf->hw, pg_arr, pg_cnt);
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  582  	irdma_free_pble(rf-
> >pble_rsrc, &aeq->palloc);
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  583  	vfree(aeq->mem.va);
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  584  }
> 44d9e52977a1b9 Mustafa Ismail 2021-06-02  585
> 
> :::::: The code at line 579 was first introduced by commit
> :::::: 44d9e52977a1b90b0db1c7f8b197c218e9226520 RDMA/irdma: Implement 
> device initialization definitions
> 
> :::::: TO: Mustafa Ismail <mustafa.ismail@xxxxxxxxx>
> :::::: CC: Jason Gunthorpe <jgg@xxxxxxxxxx>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation 
> https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux