All of lore.kernel.org
 help / color / mirror / Atom feed
* [openeuler:OLK-6.6 3098/3098] drivers/iommu/hisilicon/ummu-core/core_iova.c:252:19: warning: no previous prototype for function 'dma_alloc_iova'
@ 2025-11-03 22:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-03 22:45 UTC (permalink / raw)
  To: kernel, Lei Gong; +Cc: oe-kbuild-all

tree:   https://gitee.com/openeuler/kernel.git OLK-6.6
head:   a29fc03bd0ddaf7388cf31604ef5bd9807585109
commit: 80e4e47da66d941f2265d9d6c449880553254119 [3098/3098] iommu/ummu-core: support IOVA on demand mapping
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20251104/202511040647.7fLTNmOG-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251104/202511040647.7fLTNmOG-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/202511040647.7fLTNmOG-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/iommu/hisilicon/ummu-core/core_iova.c:252:19: warning: no previous prototype for function 'dma_alloc_iova' [-Wmissing-prototypes]
     252 | struct iova_slot *dma_alloc_iova(struct device *dev, size_t size,
         |                   ^
   drivers/iommu/hisilicon/ummu-core/core_iova.c:252:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     252 | struct iova_slot *dma_alloc_iova(struct device *dev, size_t size,
         | ^
         | static 
>> drivers/iommu/hisilicon/ummu-core/core_iova.c:290:6: warning: no previous prototype for function 'dma_free_iova' [-Wmissing-prototypes]
     290 | void dma_free_iova(struct iova_slot *slot)
         |      ^
   drivers/iommu/hisilicon/ummu-core/core_iova.c:290:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     290 | void dma_free_iova(struct iova_slot *slot)
         | ^
         | static 
>> drivers/iommu/hisilicon/ummu-core/core_iova.c:298:5: warning: no previous prototype for function 'ummu_fill_pages' [-Wmissing-prototypes]
     298 | int ummu_fill_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)
         |     ^
   drivers/iommu/hisilicon/ummu-core/core_iova.c:298:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     298 | int ummu_fill_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)
         | ^
         | static 
>> drivers/iommu/hisilicon/ummu-core/core_iova.c:333:5: warning: no previous prototype for function 'ummu_drain_pages' [-Wmissing-prototypes]
     333 | int ummu_drain_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)
         |     ^
   drivers/iommu/hisilicon/ummu-core/core_iova.c:333:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     333 | int ummu_drain_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)
         | ^
         | static 
   4 warnings generated.


vim +/dma_alloc_iova +252 drivers/iommu/hisilicon/ummu-core/core_iova.c

   251	
 > 252	struct iova_slot *dma_alloc_iova(struct device *dev, size_t size,
   253					 unsigned long attrs, dma_addr_t *iovap,
   254					 size_t *sizep)
   255	{
   256		struct iommu_domain *domain;
   257		struct iova_slot *slot;
   258		dma_addr_t iova;
   259		int ret;
   260	
   261		size = PAGE_ALIGN(size);
   262		domain = iommu_get_domain_for_dev(dev);
   263		if (!domain || !iommu_is_dma_domain(domain)) {
   264			ret = -ENODEV;
   265			goto err_out;
   266		}
   267		iova = domain_alloc_iova(domain, size, dev->coherent_dma_mask, dev);
   268		if (!iova) {
   269			ret = -EFAULT;
   270			goto err_out;
   271		}
   272	
   273		slot = alloc_iova_slot(dev, iova, size, attrs);
   274		if (!slot) {
   275			ret = -ENOMEM;
   276			goto err_free_iova;
   277		}
   278	
   279		*iovap = iova;
   280		*sizep = size;
   281		return slot;
   282	
   283	err_free_iova:
   284		domain_free_iova(domain, iova, size);
   285	err_out:
   286		return ERR_PTR(ret);
   287	}
   288	EXPORT_SYMBOL_GPL(dma_alloc_iova);
   289	
 > 290	void dma_free_iova(struct iova_slot *slot)
   291	{
   292		drain_pages(slot, slot->iova, slot->nr_pages);
   293		domain_free_iova(slot->domain, slot->iova, slot->nr_pages << PAGE_SHIFT);
   294		free_iova_slot(slot);
   295	}
   296	EXPORT_SYMBOL_GPL(dma_free_iova);
   297	
 > 298	int ummu_fill_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)
   299	{
   300		struct page **pages;
   301		unsigned long i;
   302		int ret;
   303	
   304		if (!IS_ALIGNED(iova, PAGE_SIZE) || !nr_pages)
   305			return -EINVAL;
   306	
   307		if (!check_iova_range(slot, iova, nr_pages))
   308			return -EINVAL;
   309	
   310		if (!check_iova_bitmap_region(slot, iova_bitmap_offset(slot, iova), nr_pages, true))
   311			return -EEXIST;
   312	
   313		pages = allocate_pages(slot->dev, nr_pages, GFP_KERNEL | __GFP_ZERO);
   314		if (!pages)
   315			return -ENOMEM;
   316	
   317		ret = map_pages(slot, iova, nr_pages, pages);
   318		if (ret != 0)
   319			goto err_free_pages;
   320	
   321		bitmap_set(slot->bitmap, iova_bitmap_offset(slot, iova), nr_pages);
   322		kvfree(pages);
   323		return 0;
   324	
   325	err_free_pages:
   326		for (i = 0; i < nr_pages; i++)
   327			__free_page(pages[i]);
   328		kvfree(pages);
   329		return ret;
   330	}
   331	EXPORT_SYMBOL_GPL(ummu_fill_pages);
   332	
 > 333	int ummu_drain_pages(struct iova_slot *slot, dma_addr_t iova, unsigned long nr_pages)

-- 
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-11-03 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 22:45 [openeuler:OLK-6.6 3098/3098] drivers/iommu/hisilicon/ummu-core/core_iova.c:252:19: warning: no previous prototype for function 'dma_alloc_iova' 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.