* [bug report] mm: wire up GFP flag passing in dma_alloc_from_contiguous
@ 2017-02-14 8:32 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-02-14 8:32 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-14 8:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 8:32 [bug report] mm: wire up GFP flag passing in dma_alloc_from_contiguous 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).