All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
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	[thread overview]
Message-ID: <202112021920.4UM5eC18-lkp@intel.com> (raw)

[-- 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

                 reply	other threads:[~2021-12-02 11:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202112021920.4UM5eC18-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@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.