aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Mason <jdmason@us.ibm.com>2006-06-26 07:56:19 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:48:14 -0400
commit9f2036f3e280ef1df072c5b2ca115a0e766c1d10 (patch)
treeaea40066112f6621fdbfec5d8fb5321e6f338fb4
parentd167a51877e94dda73dd656c51f363502309f713 (diff)
[PATCH] x86_64: pci-dma.c clean-up - trivial
Replace hard coded DMA masks with #defines from include/linux/dma-mapping.h Signed-off-by: Jon Mason <jdmason@us.ibm.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/x86_64/kernel/pci-dma.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c
index a9275c9557cf..117bcebe9ebc 100644
--- a/arch/x86_64/kernel/pci-dma.c
+++ b/arch/x86_64/kernel/pci-dma.c
@@ -38,7 +38,7 @@ int force_iommu __read_mostly= 0;
38 to i386. */ 38 to i386. */
39struct device fallback_dev = { 39struct device fallback_dev = {
40 .bus_id = "fallback device", 40 .bus_id = "fallback device",
41 .coherent_dma_mask = 0xffffffff, 41 .coherent_dma_mask = DMA_32BIT_MASK,
42 .dma_mask = &fallback_dev.coherent_dma_mask, 42 .dma_mask = &fallback_dev.coherent_dma_mask,
43}; 43};
44 44
@@ -77,7 +77,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
77 dev = &fallback_dev; 77 dev = &fallback_dev;
78 dma_mask = dev->coherent_dma_mask; 78 dma_mask = dev->coherent_dma_mask;
79 if (dma_mask == 0) 79 if (dma_mask == 0)
80 dma_mask = 0xffffffff; 80 dma_mask = DMA_32BIT_MASK;
81 81
82 /* Don't invoke OOM killer */ 82 /* Don't invoke OOM killer */
83 gfp |= __GFP_NORETRY; 83 gfp |= __GFP_NORETRY;
@@ -90,7 +90,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
90 larger than 16MB and in this case we have a chance of 90 larger than 16MB and in this case we have a chance of
91 finding fitting memory in the next higher zone first. If 91 finding fitting memory in the next higher zone first. If
92 not retry with true GFP_DMA. -AK */ 92 not retry with true GFP_DMA. -AK */
93 if (dma_mask <= 0xffffffff) 93 if (dma_mask <= DMA_32BIT_MASK)
94 gfp |= GFP_DMA32; 94 gfp |= GFP_DMA32;
95 95
96 again: 96 again:
@@ -111,7 +111,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
111 111
112 /* Don't use the 16MB ZONE_DMA unless absolutely 112 /* Don't use the 16MB ZONE_DMA unless absolutely
113 needed. It's better to use remapping first. */ 113 needed. It's better to use remapping first. */
114 if (dma_mask < 0xffffffff && !(gfp & GFP_DMA)) { 114 if (dma_mask < DMA_32BIT_MASK && !(gfp & GFP_DMA)) {
115 gfp = (gfp & ~GFP_DMA32) | GFP_DMA; 115 gfp = (gfp & ~GFP_DMA32) | GFP_DMA;
116 goto again; 116 goto again;
117 } 117 }
@@ -174,7 +174,7 @@ int dma_supported(struct device *dev, u64 mask)
174 /* Copied from i386. Doesn't make much sense, because it will 174 /* Copied from i386. Doesn't make much sense, because it will
175 only work for pci_alloc_coherent. 175 only work for pci_alloc_coherent.
176 The caller just has to use GFP_DMA in this case. */ 176 The caller just has to use GFP_DMA in this case. */
177 if (mask < 0x00ffffff) 177 if (mask < DMA_24BIT_MASK)
178 return 0; 178 return 0;
179 179
180 /* Tell the device to use SAC when IOMMU force is on. This 180 /* Tell the device to use SAC when IOMMU force is on. This
@@ -189,7 +189,7 @@ int dma_supported(struct device *dev, u64 mask)
189 SAC for these. Assume all masks <= 40 bits are of this 189 SAC for these. Assume all masks <= 40 bits are of this
190 type. Normally this doesn't make any difference, but gives 190 type. Normally this doesn't make any difference, but gives
191 more gentle handling of IOMMU overflow. */ 191 more gentle handling of IOMMU overflow. */
192 if (iommu_sac_force && (mask >= 0xffffffffffULL)) { 192 if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
193 printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev->bus_id,mask); 193 printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev->bus_id,mask);
194 return 0; 194 return 0;
195 } 195 }