linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dan.carpenter@oracle.com (Dan Carpenter)
To: linux-arm-kernel@lists.infradead.org
Subject: [bug report] mm: wire up GFP flag passing in dma_alloc_from_contiguous
Date: Tue, 14 Feb 2017 11:32:41 +0300	[thread overview]
Message-ID: <20170214083241.GA20170@mwanda> (raw)

Hello Lucas Stach,

The patch 179d4caa7d17: "mm: wire up GFP flag passing in
dma_alloc_from_contiguous" from Feb 8, 2017, leads to the following
static checker warning:

	arch/arm/mm/dma-mapping.c:615 __alloc_from_contiguous()
	warn: use 'gfp' here instead of GFP_XXX?

arch/arm/mm/dma-mapping.c
   595  static void *__alloc_from_contiguous(struct device *dev, size_t size,
   596                                       pgprot_t prot, struct page **ret_page,
   597                                       const void *caller, bool want_vaddr,
   598                                       int coherent_flag, gfp_t gfp)
   599  {
   600          unsigned long order = get_order(size);
   601          size_t count = size >> PAGE_SHIFT;
   602          struct page *page;
   603          void *ptr = NULL;
   604  
   605          page = dma_alloc_from_contiguous(dev, count, order, gfp);
   606          if (!page)
   607                  return NULL;
   608  
   609          __dma_clear_buffer(page, size, coherent_flag);
   610  
   611          if (!want_vaddr)
   612                  goto out;
   613  
   614          if (PageHighMem(page)) {
   615                  ptr = __dma_alloc_remap(page, size, GFP_KERNEL, prot, caller);
                                                            ^^^^^^^^^^
Use "gfp" here as well?  I don't know...

   616                  if (!ptr) {
   617                          dma_release_from_contiguous(dev, page, count);
   618                          return NULL;
   619                  }
   620          } else {
   621                  __dma_remap(page, size, prot);
   622                  ptr = page_address(page);
   623          }
   624  
   625   out:
   626          *ret_page = page;
   627          return ptr;
   628  }

regards,
dan carpenter

                 reply	other threads:[~2017-02-14  8:32 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=20170214083241.GA20170@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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).