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

Commit 2f4f27d4 authored by Yang Hongyang's avatar Yang Hongyang Committed by Linus Torvalds
Browse files

dma-mapping: replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24)



Replace all DMA_24BIT_MASK macro with DMA_BIT_MASK(24)

Signed-off-by: default avatarYang <Hongyang&lt;yanghy@cn.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ce0b6201
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ int iommu_dma_supported(struct device *dev, u64 mask)
	/* Copied from i386. Doesn't make much sense, because it will
	   only work for pci_alloc_coherent.
	   The caller just has to use GFP_DMA in this case. */
	if (mask < DMA_24BIT_MASK)
	if (mask < DMA_BIT_MASK(24))
		return 0;

	/* Tell the device to use SAC when IOMMU force is on.  This
+2 −2
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ static inline unsigned long dma_alloc_coherent_mask(struct device *dev,

	dma_mask = dev->coherent_dma_mask;
	if (!dma_mask)
		dma_mask = (gfp & GFP_DMA) ? DMA_24BIT_MASK : DMA_BIT_MASK(32);
		dma_mask = (gfp & GFP_DMA) ? DMA_BIT_MASK(24) : DMA_BIT_MASK(32);

	return dma_mask;
}
@@ -247,7 +247,7 @@ static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp)
{
	unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp);

	if (dma_mask <= DMA_24BIT_MASK)
	if (dma_mask <= DMA_BIT_MASK(24))
		gfp |= GFP_DMA;
#ifdef CONFIG_X86_64
	if (dma_mask <= DMA_BIT_MASK(32) && !(gfp & GFP_DMA))
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ int dma_supported(struct device *dev, u64 mask)
	/* Copied from i386. Doesn't make much sense, because it will
	   only work for pci_alloc_coherent.
	   The caller just has to use GFP_DMA in this case. */
	if (mask < DMA_24BIT_MASK)
	if (mask < DMA_BIT_MASK(24))
		return 0;

	/* Tell the device to use SAC when IOMMU force is on.  This
+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev)
		isa_dev->dev.release		= isa_dev_release;
		isa_dev->id			= id;

		isa_dev->dev.coherent_dma_mask = DMA_24BIT_MASK;
		isa_dev->dev.coherent_dma_mask = DMA_BIT_MASK(24);
		isa_dev->dev.dma_mask = &isa_dev->dev.coherent_dma_mask;

		error = device_register(&isa_dev->dev);
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *protocol, int id, char *pnp
	card->dev.parent = &card->protocol->dev;
	dev_set_name(&card->dev, "%02x:%02x", card->protocol->number, card->number);

	card->dev.coherent_dma_mask = DMA_24BIT_MASK;
	card->dev.coherent_dma_mask = DMA_BIT_MASK(24);
	card->dev.dma_mask = &card->dev.coherent_dma_mask;

	dev_id = pnp_add_card_id(card, pnpid);
Loading