direct-io.hg

changeset 4542:1e5599e62873

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>
author chrisw@osdl.org[iap10]
date Fri Apr 15 22:15:40 2005 +0000 (2005-04-15)
parents 7ea030aa6f3f
children 3dac50183187
files linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Fri Apr 15 22:15:24 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c	Fri Apr 15 22:15:40 2005 +0000
     1.3 @@ -14,14 +14,7 @@
     1.4  #include <linux/version.h>
     1.5  #include <asm/io.h>
     1.6  #include <asm-xen/balloon.h>
     1.7 -
     1.8 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     1.9  #include <asm/tlbflush.h>
    1.10 -#else
    1.11 -#define pte_offset_kernel pte_offset
    1.12 -#define pud_t pgd_t
    1.13 -#define pud_offset(d, va) d
    1.14 -#endif
    1.15  
    1.16  struct dma_coherent_mem {
    1.17  	void		*virt_base;
    1.18 @@ -85,24 +78,13 @@ xen_contig_memory(unsigned long vstart, 
    1.19  	balloon_unlock(flags);
    1.20  }
    1.21  
    1.22 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    1.23 -void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
    1.24 -			   dma_addr_t *dma_handle)
    1.25 -#else
    1.26  void *dma_alloc_coherent(struct device *dev, size_t size,
    1.27  			   dma_addr_t *dma_handle, int gfp)
    1.28 -#endif
    1.29  {
    1.30  	void *ret;
    1.31  	unsigned int order = get_order(size);
    1.32  	unsigned long vstart;
    1.33  
    1.34 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    1.35 -	int gfp = GFP_ATOMIC;
    1.36 -
    1.37 -	if (hwdev == NULL || ((u32)hwdev->dma_mask < 0xffffffff))
    1.38 -		gfp |= GFP_DMA;
    1.39 -#else
    1.40  	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
    1.41  
    1.42  	/* ignore region specifiers */
    1.43 @@ -123,7 +105,6 @@ void *dma_alloc_coherent(struct device *
    1.44  
    1.45  	if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
    1.46  		gfp |= GFP_DMA;
    1.47 -#endif
    1.48  
    1.49  	vstart = __get_free_pages(gfp, order);
    1.50  	ret = (void *)vstart;
    1.51 @@ -138,14 +119,6 @@ void *dma_alloc_coherent(struct device *
    1.52  	return ret;
    1.53  }
    1.54  
    1.55 -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    1.56 -void pci_free_consistent(struct pci_dev *hwdev, size_t size,
    1.57 -			 void *vaddr, dma_addr_t dma_handle)
    1.58 -{
    1.59 -	free_pages((unsigned long)vaddr, get_order(size));
    1.60 -}
    1.61 -#else
    1.62 -
    1.63  void dma_free_coherent(struct device *dev, size_t size,
    1.64  			 void *vaddr, dma_addr_t dma_handle)
    1.65  {
    1.66 @@ -236,5 +209,3 @@ void *dma_mark_declared_memory_occupied(
    1.67  	return mem->virt_base + (pos << PAGE_SHIFT);
    1.68  }
    1.69  EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
    1.70 -
    1.71 -#endif