[ogabbay:habanalabs-next 33/34] drivers/misc/habanalabs/gaudi/gaudi.c:5041:5: warning: no previous prototype for 'gaudi_get_dma_desc_list_size'
From: kernel test robot
Date: Mon Apr 11 2022 - 12:40:09 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git habanalabs-next
head: e3e6111dba082a2d77e80ae99a2de75adff9b875
commit: 7d3600a8f9ffc668f66678211d41eadb224a4dd8 [33/34] habanalabs: use for_each_sgtable_dma_sg for dma sgt
config: sparc-buildonly-randconfig-r006-20220411 (https://download.01.org/0day-ci/archive/20220412/202204120049.nXnmmmRn-lkp@xxxxxxxxx/config)
compiler: sparc64-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://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git/commit/?id=7d3600a8f9ffc668f66678211d41eadb224a4dd8
git remote add ogabbay https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux.git
git fetch --no-tags ogabbay habanalabs-next
git checkout 7d3600a8f9ffc668f66678211d41eadb224a4dd8
# 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=sparc SHELL=/bin/bash drivers/misc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
>> drivers/misc/habanalabs/gaudi/gaudi.c:5041:5: warning: no previous prototype for 'gaudi_get_dma_desc_list_size' [-Wmissing-prototypes]
5041 | u32 gaudi_get_dma_desc_list_size(struct hl_device *hdev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/gaudi_get_dma_desc_list_size +5041 drivers/misc/habanalabs/gaudi/gaudi.c
5040
> 5041 u32 gaudi_get_dma_desc_list_size(struct hl_device *hdev,
5042 struct sg_table *sgt)
5043 {
5044 struct scatterlist *sg, *sg_next_iter;
5045 u32 count, dma_desc_cnt;
5046 u64 len, len_next;
5047 dma_addr_t addr, addr_next;
5048
5049 dma_desc_cnt = 0;
5050
5051 for_each_sgtable_dma_sg(sgt, sg, count) {
5052 len = sg_dma_len(sg);
5053 addr = sg_dma_address(sg);
5054
5055 if (len == 0)
5056 break;
5057
5058 while ((count + 1) < sgt->nents) {
5059 sg_next_iter = sg_next(sg);
5060 len_next = sg_dma_len(sg_next_iter);
5061 addr_next = sg_dma_address(sg_next_iter);
5062
5063 if (len_next == 0)
5064 break;
5065
5066 if ((addr + len == addr_next) &&
5067 (len + len_next <= DMA_MAX_TRANSFER_SIZE)) {
5068 len += len_next;
5069 count++;
5070 sg = sg_next_iter;
5071 } else {
5072 break;
5073 }
5074 }
5075
5076 dma_desc_cnt++;
5077 }
5078
5079 return dma_desc_cnt * sizeof(struct packet_lin_dma);
5080 }
5081
--
0-DAY CI Kernel Test Service
https://01.org/lkp