On Wed, Jul 22, 2020 at 04:43:07PM +0200, Christoph Hellwig wrote: > Split out a cma_alloc_aligned helper to deal with the "interesting" > calling conventions for cma_alloc, which then allows to the main > function to be written straight forward. This also takes advantage > of the fact that NULL dev arguments have been gone from the DMA API > for a while. > > Signed-off-by: Christoph Hellwig <[email protected]> > --- > kernel/dma/contiguous.c | 31 ++++++++++++++----------------- > 1 file changed, 14 insertions(+), 17 deletions(-) > > diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c > index 15bc5026c485f2..f16b8d3f9932de 100644 > --- a/kernel/dma/contiguous.c > +++ b/kernel/dma/contiguous.c > @@ -215,6 +215,13 @@ bool dma_release_from_contiguous(struct device *dev, > struct page *pages, > return cma_release(dev_get_cma_area(dev), pages, count); > } > > +static struct page *cma_alloc_aligned(struct cma *cma, size_t size, gfp_t > gfp) > +{ > + return cma_alloc(dma_contiguous_default_area, size >> PAGE_SHIFT,
Probably should be 'cma' here instead of 'dma_contiguous_default_area'? _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
