All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: jroedel@suse.de
Cc: iommu@lists.linux-foundation.org
Subject: [bug report] iommu/amd: Pass gfp-flags to iommu_map_page()
Date: Wed, 16 Oct 2019 21:33:50 +0300	[thread overview]
Message-ID: <20191016183350.GA16377@mwanda> (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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

                 reply	other threads:[~2019-10-16 18:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191016183350.GA16377@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.