From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7927670878823688252==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [intel-lts:5.10/android-civ 15431/23680] drivers/dma-buf/dma-heap.c:100:24: warning: returning 'long int' from a function with return type 'struct dma_buf *' makes pointer from integer without a cast Date: Thu, 02 Dec 2021 19:38:32 +0800 Message-ID: <202112021920.4UM5eC18-lkp@intel.com> List-Id: --===============7927670878823688252== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://github.com/intel/linux-intel-lts.git 5.10/android-civ head: 0e493748b235bf61d817dabdad2832ac4e932217 commit: 14a9cab5293224679fea27d71bef4cd3acc0c72c [15431/23680] Merge remote= -tracking branch 'origin/5.10/yocto' into 5.10/android config: ia64-randconfig-r002-20211202 (https://download.01.org/0day-ci/arch= ive/20211202/202112021920.4UM5eC18-lkp(a)intel.com/config) compiler: ia64-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel/linux-intel-lts/commit/14a9cab5293224679= fea27d71bef4cd3acc0c72c git remote add intel-lts https://github.com/intel/linux-intel-lts.g= it git fetch --no-tags intel-lts 5.10/android-civ git checkout 14a9cab5293224679fea27d71bef4cd3acc0c72c # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dia64 SHELL=3D/bin/bash drivers/dma-buf/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/dma-buf/dma-heap.c: In function 'dma_heap_buffer_alloc': >> drivers/dma-buf/dma-heap.c:100:24: warning: returning 'long int' from a = function with return type 'struct dma_buf *' makes pointer from integer wit= hout a cast [-Wint-conversion] 100 | return PTR_ERR(dmabuf); | ^~~~~~~~~~~~~~~ >> drivers/dma-buf/dma-heap.c:107:16: warning: returning 'int' from a funct= ion with return type 'struct dma_buf *' makes pointer from integer without = a cast [-Wint-conversion] 107 | return fd; | ^~ vim +100 drivers/dma-buf/dma-heap.c 349e8360c9c85c9 John Stultz 2020-08-14 77 = 349e8360c9c85c9 John Stultz 2020-08-14 78 struct dma_buf *dma_heap_b= uffer_alloc(struct dma_heap *heap, size_t len, c02a81fba74fe34 Andrew F. Davis 2019-12-03 79 unsigned int fd_= flags, c02a81fba74fe34 Andrew F. Davis 2019-12-03 80 unsigned int hea= p_flags) c02a81fba74fe34 Andrew F. Davis 2019-12-03 81 { 1998121ad755410 John Stultz 2021-01-19 82 struct dma_buf *dmabuf; 1998121ad755410 John Stultz 2021-01-19 83 int fd; 1998121ad755410 John Stultz 2021-01-19 84 = fc1310ebf8fe25e John Stultz 2020-05-05 85 if (fd_flags & ~DMA_HEAP_= VALID_FD_FLAGS) 349e8360c9c85c9 John Stultz 2020-08-14 86 return ERR_PTR(-EINVAL); fc1310ebf8fe25e John Stultz 2020-05-05 87 = fc1310ebf8fe25e John Stultz 2020-05-05 88 if (heap_flags & ~DMA_HEA= P_VALID_HEAP_FLAGS) 349e8360c9c85c9 John Stultz 2020-08-14 89 return ERR_PTR(-EINVAL); c02a81fba74fe34 Andrew F. Davis 2019-12-03 90 /* c02a81fba74fe34 Andrew F. Davis 2019-12-03 91 * Allocations from all h= eaps have to begin c02a81fba74fe34 Andrew F. Davis 2019-12-03 92 * and end on page bounda= ries. c02a81fba74fe34 Andrew F. Davis 2019-12-03 93 */ c02a81fba74fe34 Andrew F. Davis 2019-12-03 94 len =3D PAGE_ALIGN(len); c02a81fba74fe34 Andrew F. Davis 2019-12-03 95 if (!len) 349e8360c9c85c9 John Stultz 2020-08-14 96 return ERR_PTR(-EINVAL); c02a81fba74fe34 Andrew F. Davis 2019-12-03 97 = 1998121ad755410 John Stultz 2021-01-19 98 dmabuf =3D heap->ops->all= ocate(heap, len, fd_flags, heap_flags); 1998121ad755410 John Stultz 2021-01-19 99 if (IS_ERR(dmabuf)) 1998121ad755410 John Stultz 2021-01-19 @100 return PTR_ERR(dmabuf); 1998121ad755410 John Stultz 2021-01-19 101 = 1998121ad755410 John Stultz 2021-01-19 102 fd =3D dma_buf_fd(dmabuf,= fd_flags); 1998121ad755410 John Stultz 2021-01-19 103 if (fd < 0) { 1998121ad755410 John Stultz 2021-01-19 104 dma_buf_put(dmabuf); 1998121ad755410 John Stultz 2021-01-19 105 /* just return, as put w= ill call release and that will free */ 1998121ad755410 John Stultz 2021-01-19 106 } 1998121ad755410 John Stultz 2021-01-19 @107 return fd; c02a81fba74fe34 Andrew F. Davis 2019-12-03 108 } 8e1ec97355ef992 John Stultz 2020-05-05 109 EXPORT_SYMBOL_GPL(dma_heap= _buffer_alloc); c02a81fba74fe34 Andrew F. Davis 2019-12-03 110 = :::::: The code@line 100 was first introduced by commit :::::: 1998121ad755410f4a617676863177d7e4cc0cc6 dma-buf: heaps: Rework heap= allocation hooks to return struct dma_buf instead of fd :::::: TO: John Stultz :::::: CC: Dutta, Ranjan --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============7927670878823688252==--