[ogabbay:habanalabs-next 33/34] drivers/misc/habanalabs/gaudi/gaudi.c:5041:5: warning: no previous prototype for function 'gaudi_get_dma_desc_list_size'

kernel test robot
2022-04-11T17:53:34Z

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: x86_64-randconfig-a002-20220411 (https://download.01.org/0day-ci/archive/20220412/202204120146.AaaXilN7-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c6e83f560f06cdfe8aa47b248d8bdc58f947274b)
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=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/misc/

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/misc/habanalabs/gaudi/gaudi.c:5041:5: warning: no previous prototype for function 'gaudi_get_dma_desc_list_size' [-Wmissing-prototypes]
u32 gaudi_get_dma_desc_list_size(struct hl_device *hdev,
^
drivers/misc/habanalabs/gaudi/gaudi.c:5041:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 gaudi_get_dma_desc_list_size(struct hl_device *hdev,
^
static
1 warning generated.

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