* [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
@ 2021-12-02 11:38 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-12-02 11:38 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4792 bytes --]
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/archive/20211202/202112021920.4UM5eC18-lkp(a)intel.com/config)
compiler: ia64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 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/14a9cab5293224679fea27d71bef4cd3acc0c72c
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
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=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/dma-buf/
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/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 without a cast [-Wint-conversion]
100 | return PTR_ERR(dmabuf);
| ^~~~~~~~~~~~~~~
>> drivers/dma-buf/dma-heap.c:107:16: warning: returning 'int' from a function 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_buffer_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 heap_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_HEAP_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 heaps have to begin
c02a81fba74fe34 Andrew F. Davis 2019-12-03 92 * and end on page boundaries.
c02a81fba74fe34 Andrew F. Davis 2019-12-03 93 */
c02a81fba74fe34 Andrew F. Davis 2019-12-03 94 len = 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 = heap->ops->allocate(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 = 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 will 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 <john.stultz@linaro.org>
:::::: CC: Dutta, Ranjan <ranjan.dutta@intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-02 11:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-02 11:38 [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 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.