iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [bug report] iommu/amd: Pass gfp-flags to iommu_map_page()
@ 2019-10-16 18:33 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-10-16 18:33 UTC (permalink / raw)
  To: jroedel; +Cc: iommu

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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

only message in thread, other threads:[~2019-10-16 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 18:33 [bug report] iommu/amd: Pass gfp-flags to iommu_map_page() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).