bitkeeper revision 1.1304 (42603d0cFBy4o8Z0uWMo4r_vc6tf2g)

[PATCH] [PATCH] Eliminate kernel version checks from

Eliminate kernel version checks from i386/kernel/pci-dma.c as a trivial
first pass cleanup towards merging.

Signed-off-by: Chris Wright <chrisw@osdl.org>
This commit is contained in:
chrisw@osdl.org[iap10] committed 2005-04-15 22:15:40 +00:00
1 parent d3469aaace
commit fef1e0d218
1 file changed
-29
@@ -14,14 +14,7 @@
#include <linux/version.h>
#include <asm/io.h>
#include <asm-xen/balloon.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <asm/tlbflush.h>
#else
#define pte_offset_kernel pte_offset
#define pud_t pgd_t
#define pud_offset(d, va) d
#endif
struct dma_coherent_mem {
void *virt_base;
@@ -85,24 +78,13 @@ xen_contig_memory(unsigned long vstart, unsigned int order)
balloon_unlock(flags);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle)
#else
void *dma_alloc_coherent(struct device *dev, size_t size,
dma_addr_t *dma_handle, int gfp)
#endif
{
void *ret;
unsigned int order = get_order(size);
unsigned long vstart;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
int gfp = GFP_ATOMIC;
if (hwdev == NULL || ((u32)hwdev->dma_mask < 0xffffffff))
gfp |= GFP_DMA;
#else
struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
/* ignore region specifiers */
@@ -123,7 +105,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
gfp |= GFP_DMA;
#endif
vstart = __get_free_pages(gfp, order);
ret = (void *)vstart;
@@ -138,14 +119,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
return ret;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
void pci_free_consistent(struct pci_dev *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
free_pages((unsigned long)vaddr, get_order(size));
}
#else
void dma_free_coherent(struct device *dev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
@@ -236,5 +209,3 @@ void *dma_mark_declared_memory_occupied(struct device *dev,
return mem->virt_base + (pos << PAGE_SHIFT);
}
EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
#endif
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.