Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [leon-rdma:dmabuf-vfio 42/42] kernel/dma/mapping.c:174:2: warning: non-void function does not return a value in all control paths
@ 2025-09-16 20:19 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-09-16 20:19 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: llvm, oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git dmabuf-vfio
head:   887b59804850b679831fda6eba707cc1b1b077e0
commit: 887b59804850b679831fda6eba707cc1b1b077e0 [42/42] dma-mapping: remove unused map_page callback
config: x86_64-buildonly-randconfig-002-20250916 (https://download.01.org/0day-ci/archive/20250917/202509170453.TJrTBB4U-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250917/202509170453.TJrTBB4U-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509170453.TJrTBB4U-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/dma/mapping.c:160:13: warning: variable 'addr' set but not used [-Wunused-but-set-variable]
     160 |         dma_addr_t addr = DMA_MAPPING_ERROR;
         |                    ^
>> kernel/dma/mapping.c:174:2: warning: non-void function does not return a value in all control paths [-Wreturn-type]
     174 |         }
         |         ^
   kernel/dma/mapping.c:176:2: error: expected identifier or '('
     176 |         if (!is_mmio)
         |         ^
   kernel/dma/mapping.c:178:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     178 |         trace_dma_map_phys(dev, phys, addr, size, dir, attrs);
         |         ^
         |         int
   kernel/dma/mapping.c:178:21: error: a parameter list without types is only allowed in a function definition
     178 |         trace_dma_map_phys(dev, phys, addr, size, dir, attrs);
         |                            ^
   kernel/dma/mapping.c:179:2: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
     179 |         debug_dma_map_phys(dev, phys, size, dir, addr, attrs);
         |         ^
         |         int
   kernel/dma/mapping.c:179:21: error: a parameter list without types is only allowed in a function definition
     179 |         debug_dma_map_phys(dev, phys, size, dir, addr, attrs);
         |                            ^
   kernel/dma/mapping.c:181:2: error: expected identifier or '('
     181 |         return addr;
         |         ^
   kernel/dma/mapping.c:182:1: error: extraneous closing brace ('}')
     182 | }
         | ^
   2 warnings and 7 errors generated.


vim +174 kernel/dma/mapping.c

d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  154  
98aa19211ca8ab Leon Romanovsky      2025-06-17  155  dma_addr_t dma_map_phys(struct device *dev, phys_addr_t phys, size_t size,
98aa19211ca8ab Leon Romanovsky      2025-06-17  156  		enum dma_data_direction dir, unsigned long attrs)
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  157  {
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  158  	const struct dma_map_ops *ops = get_dma_ops(dev);
c332420ebc1822 Leon Romanovsky      2025-06-17  159  	bool is_mmio = attrs & DMA_ATTR_MMIO;
19e1683200df53 Leon Romanovsky      2025-09-15 @160  	dma_addr_t addr = DMA_MAPPING_ERROR;
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  161  
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  162  	BUG_ON(!valid_dma_direction(dir));
f959dcd6ddfd29 Thomas Tai           2020-09-17  163  
f959dcd6ddfd29 Thomas Tai           2020-09-17  164  	if (WARN_ON_ONCE(!dev->dma_mask))
f959dcd6ddfd29 Thomas Tai           2020-09-17  165  		return DMA_MAPPING_ERROR;
f959dcd6ddfd29 Thomas Tai           2020-09-17  166  
8d8d53cf8fd028 Alexey Kardashevskiy 2020-10-29  167  	if (dma_map_direct(dev, ops) ||
c332420ebc1822 Leon Romanovsky      2025-06-17  168  	    (!is_mmio && arch_dma_map_phys_direct(dev, phys + size)))
907f79a29dcbc1 Leon Romanovsky      2025-06-17  169  		addr = dma_direct_map_phys(dev, phys, size, dir, attrs);
b5c58b2fdc427e Leon Romanovsky      2024-07-24  170  	else if (use_dma_iommu(dev))
fe635b87c42ebd Leon Romanovsky      2025-06-17  171  		addr = iommu_dma_map_phys(dev, phys, size, dir, attrs);
098e1e1eeeee44 Leon Romanovsky      2025-09-15  172  	else if (ops->map_phys)
098e1e1eeeee44 Leon Romanovsky      2025-09-15  173  		addr = ops->map_phys(dev, phys, size, dir, attrs);
c332420ebc1822 Leon Romanovsky      2025-06-17 @174  	}
00730608c19fca Leon Romanovsky      2025-06-17  175  
c332420ebc1822 Leon Romanovsky      2025-06-17  176  	if (!is_mmio)
00730608c19fca Leon Romanovsky      2025-06-17  177  		kmsan_handle_dma(phys, size, dir);
7d6250d472a5fb Leon Romanovsky      2025-06-17  178  	trace_dma_map_phys(dev, phys, addr, size, dir, attrs);
46758939d12150 Leon Romanovsky      2025-06-17  179  	debug_dma_map_phys(dev, phys, size, dir, addr, attrs);
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  180  
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  181  	return addr;
d3fa60d7bfdc9a Christoph Hellwig    2020-07-08  182  }
98aa19211ca8ab Leon Romanovsky      2025-06-17  183  EXPORT_SYMBOL_GPL(dma_map_phys);
98aa19211ca8ab Leon Romanovsky      2025-06-17  184  

:::::: The code at line 174 was first introduced by commit
:::::: c332420ebc1822897e61cef6b9f361cde917dc21 dma-mapping: implement DMA_ATTR_MMIO for dma_(un)map_page_attrs()

:::::: TO: Leon Romanovsky <leonro@nvidia.com>
:::::: CC: Leon Romanovsky <leon@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-16 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16 20:19 [leon-rdma:dmabuf-vfio 42/42] kernel/dma/mapping.c:174:2: warning: non-void function does not return a value in all control paths kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox