Skip to contentSkip to conversation

iommu/amd: Pass gfp-flags to iommu_map_page()

bug report Dan Carpenter 1 participant 1 message Oct 16, 2019

lore
Share & tools
lore
#0 lore raw

Hello Joerg Roedel,

The patch b911b89b6d01: "iommu/amd: Pass gfp-flags to iommu_map_page()" from Jul 5, 2016, leads to the following static checker warning:

	drivers/iommu/amd_iommu.c:2545 amd_iommu_map()
	warn: use 'gfp' here instead of GFP_XXX?

drivers/iommu/amd_iommu.c
2529 static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova,
2530 phys_addr_t paddr, size_t page_size, int iommu_prot,
2531 gfp_t gfp)

                                 ^^^^^^^^^

I don't know why I'm suddenly getting this warning even though the code is three years old...

2532 {

  2533          struct protection_domain *domain = to_pdomain(dom);
  2534          int prot = 0;
  2535          int ret;
  2536  
  2537          if (domain->mode == PAGE_MODE_NONE)
  2538                  return -EINVAL;
  2539  
  2540          if (iommu_prot & IOMMU_READ)
  2541                  prot |= IOMMU_PROT_IR;
  2542          if (iommu_prot & IOMMU_WRITE)
  2543                  prot |= IOMMU_PROT_IW;
  2544  
  2545          ret = iommu_map_page(domain, iova, paddr, page_size, prot, GFP_KERNEL);
                                                                           ^^^^^^^^^^

But it does seem like maybe gfp was intended here?

  2546  
  2547          domain_flush_np_cache(domain, iova, page_size);
  2548  
  2549          return ret;
  2550  }

See also:
drivers/iommu/dma-iommu.c:625 iommu_dma_alloc_remap() warn: use 'gfp' here instead of GFP_XXX?

regards,
dan carpenter
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu