Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57bf5a89 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

dma-mapping: clear harmful GFP_* flags in common code



Lift the code from x86 so that we behave consistently.  In the future we
should probably warn if any of these is set.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarJesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
parent 205e1b7f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ static void *v32_dma_alloc(struct device *dev, size_t size,
{
	void *ret;

	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
		gfp |= GFP_DMA;

+0 −3
Original line number Diff line number Diff line
@@ -16,9 +16,6 @@ static void *dma_alloc(struct device *dev, size_t size,
{
	void *ret;

	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
		gfp |= GFP_DMA;
	ret = (void *)__get_free_pages(gfp, get_order(size));
+0 −2
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@ static void *m68k_dma_alloc(struct device *dev, size_t size,
		dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs)
{
	void *ret;
	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);

	if (dev == NULL || (*dev->dma_mask < 0xffffffff))
		gfp |= GFP_DMA;
+0 −3
Original line number Diff line number Diff line
@@ -161,9 +161,6 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size,
{
	void *ret;

	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);

	if (IS_ENABLED(CONFIG_ZONE_DMA) && dev == NULL)
		gfp |= __GFP_DMA;
	else if (IS_ENABLED(CONFIG_ZONE_DMA) &&
+0 −3
Original line number Diff line number Diff line
@@ -15,9 +15,6 @@ static void *loongson_dma_alloc_coherent(struct device *dev, size_t size,
{
	void *ret;

	/* ignore region specifiers */
	gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);

	if ((IS_ENABLED(CONFIG_ISA) && dev == NULL) ||
	    (IS_ENABLED(CONFIG_ZONE_DMA) &&
	     dev->coherent_dma_mask < DMA_BIT_MASK(32)))
Loading