提交 113cbeba 编写于 作者: J Joe Perches 提交者: Ingo Molnar

include/asm-x86/dma.h: checkpatch cleanups - formatting only

Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 925a09b2
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <asm/io.h> /* need byte IO */ #include <asm/io.h> /* need byte IO */
#include <linux/delay.h> #include <linux/delay.h>
#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER #ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
#define dma_outb outb_p #define dma_outb outb_p
#else #else
...@@ -74,15 +73,15 @@ ...@@ -74,15 +73,15 @@
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* The maximum address that we can perform a DMA transfer to on this platform */ /* The maximum address that we can perform a DMA transfer to on this platform */
#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x1000000) #define MAX_DMA_ADDRESS (PAGE_OFFSET + 0x1000000)
#else #else
/* 16MB ISA DMA zone */ /* 16MB ISA DMA zone */
#define MAX_DMA_PFN ((16*1024*1024) >> PAGE_SHIFT) #define MAX_DMA_PFN ((16 * 1024 * 1024) >> PAGE_SHIFT)
/* 4GB broken PCI/AGP hardware bus master zone */ /* 4GB broken PCI/AGP hardware bus master zone */
#define MAX_DMA32_PFN ((4UL*1024*1024*1024) >> PAGE_SHIFT) #define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
/* Compat define for old dma zone */ /* Compat define for old dma zone */
#define MAX_DMA_ADDRESS ((unsigned long)__va(MAX_DMA_PFN << PAGE_SHIFT)) #define MAX_DMA_ADDRESS ((unsigned long)__va(MAX_DMA_PFN << PAGE_SHIFT))
...@@ -154,20 +153,20 @@ ...@@ -154,20 +153,20 @@
extern spinlock_t dma_spin_lock; extern spinlock_t dma_spin_lock;
static __inline__ unsigned long claim_dma_lock(void) static inline unsigned long claim_dma_lock(void)
{ {
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&dma_spin_lock, flags); spin_lock_irqsave(&dma_spin_lock, flags);
return flags; return flags;
} }
static __inline__ void release_dma_lock(unsigned long flags) static inline void release_dma_lock(unsigned long flags)
{ {
spin_unlock_irqrestore(&dma_spin_lock, flags); spin_unlock_irqrestore(&dma_spin_lock, flags);
} }
/* enable/disable a specific DMA channel */ /* enable/disable a specific DMA channel */
static __inline__ void enable_dma(unsigned int dmanr) static inline void enable_dma(unsigned int dmanr)
{ {
if (dmanr <= 3) if (dmanr <= 3)
dma_outb(dmanr, DMA1_MASK_REG); dma_outb(dmanr, DMA1_MASK_REG);
...@@ -175,7 +174,7 @@ static __inline__ void enable_dma(unsigned int dmanr) ...@@ -175,7 +174,7 @@ static __inline__ void enable_dma(unsigned int dmanr)
dma_outb(dmanr & 3, DMA2_MASK_REG); dma_outb(dmanr & 3, DMA2_MASK_REG);
} }
static __inline__ void disable_dma(unsigned int dmanr) static inline void disable_dma(unsigned int dmanr)
{ {
if (dmanr <= 3) if (dmanr <= 3)
dma_outb(dmanr | 4, DMA1_MASK_REG); dma_outb(dmanr | 4, DMA1_MASK_REG);
...@@ -190,7 +189,7 @@ static __inline__ void disable_dma(unsigned int dmanr) ...@@ -190,7 +189,7 @@ static __inline__ void disable_dma(unsigned int dmanr)
* --- In order to do that, the DMA routines below should --- * --- In order to do that, the DMA routines below should ---
* --- only be used while holding the DMA lock ! --- * --- only be used while holding the DMA lock ! ---
*/ */
static __inline__ void clear_dma_ff(unsigned int dmanr) static inline void clear_dma_ff(unsigned int dmanr)
{ {
if (dmanr <= 3) if (dmanr <= 3)
dma_outb(0, DMA1_CLEAR_FF_REG); dma_outb(0, DMA1_CLEAR_FF_REG);
...@@ -199,7 +198,7 @@ static __inline__ void clear_dma_ff(unsigned int dmanr) ...@@ -199,7 +198,7 @@ static __inline__ void clear_dma_ff(unsigned int dmanr)
} }
/* set mode (above) for a specific DMA channel */ /* set mode (above) for a specific DMA channel */
static __inline__ void set_dma_mode(unsigned int dmanr, char mode) static inline void set_dma_mode(unsigned int dmanr, char mode)
{ {
if (dmanr <= 3) if (dmanr <= 3)
dma_outb(mode | dmanr, DMA1_MODE_REG); dma_outb(mode | dmanr, DMA1_MODE_REG);
...@@ -212,7 +211,7 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode) ...@@ -212,7 +211,7 @@ static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
* the lower 16 bits of the DMA current address register, but a 64k boundary * the lower 16 bits of the DMA current address register, but a 64k boundary
* may have been crossed. * may have been crossed.
*/ */
static __inline__ void set_dma_page(unsigned int dmanr, char pagenr) static inline void set_dma_page(unsigned int dmanr, char pagenr)
{ {
switch (dmanr) { switch (dmanr) {
case 0: case 0:
...@@ -243,15 +242,15 @@ static __inline__ void set_dma_page(unsigned int dmanr, char pagenr) ...@@ -243,15 +242,15 @@ static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
/* Set transfer address & page bits for specific DMA channel. /* Set transfer address & page bits for specific DMA channel.
* Assumes dma flipflop is clear. * Assumes dma flipflop is clear.
*/ */
static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a) static inline void set_dma_addr(unsigned int dmanr, unsigned int a)
{ {
set_dma_page(dmanr, a>>16); set_dma_page(dmanr, a>>16);
if (dmanr <= 3) { if (dmanr <= 3) {
dma_outb(a & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE); dma_outb(a & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE);
dma_outb((a >> 8) & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE); dma_outb((a >> 8) & 0xff, ((dmanr & 3) << 1) + IO_DMA1_BASE);
} else { } else {
dma_outb((a >> 1) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); dma_outb((a >> 1) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE);
dma_outb((a >> 9) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE); dma_outb((a >> 9) & 0xff, ((dmanr & 3) << 2) + IO_DMA2_BASE);
} }
} }
...@@ -264,18 +263,18 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a) ...@@ -264,18 +263,18 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
* Assumes dma flip-flop is clear. * Assumes dma flip-flop is clear.
* NOTE 2: "count" represents _bytes_ and must be even for channels 5-7. * NOTE 2: "count" represents _bytes_ and must be even for channels 5-7.
*/ */
static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) static inline void set_dma_count(unsigned int dmanr, unsigned int count)
{ {
count--; count--;
if (dmanr <= 3) { if (dmanr <= 3) {
dma_outb(count & 0xff, ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); dma_outb(count & 0xff, ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
dma_outb((count >> 8) & 0xff, dma_outb((count >> 8) & 0xff,
((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
} else { } else {
dma_outb((count >> 1) & 0xff, dma_outb((count >> 1) & 0xff,
((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
dma_outb((count >> 9) & 0xff, dma_outb((count >> 9) & 0xff,
((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
} }
} }
...@@ -288,7 +287,7 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) ...@@ -288,7 +287,7 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
* *
* Assumes DMA flip-flop is clear. * Assumes DMA flip-flop is clear.
*/ */
static __inline__ int get_dma_residue(unsigned int dmanr) static inline int get_dma_residue(unsigned int dmanr)
{ {
unsigned int io_port; unsigned int io_port;
/* using short to get 16-bit wrap around */ /* using short to get 16-bit wrap around */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册