diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-04-30 09:53:54 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 17:29:44 +0200 |
commit | cf1c63c3e68679dcac1cc6a37e619d9106ebc0ca (patch) | |
tree | d34d5ad3a81310fbdcf60b70e4abb1d046544dc6 /drivers/char/ip2/ip2main.c | |
parent | drivers/char/ip2/ip2main.c: replace init_module&cleanup_module with module_in... (diff) | |
download | linux-cf1c63c3e68679dcac1cc6a37e619d9106ebc0ca.tar.xz linux-cf1c63c3e68679dcac1cc6a37e619d9106ebc0ca.zip |
Char: ip2, macros cleanup
- remove i2os.h -- there was only macro to macro renaming or useless
stuff
- remove another uselless stuf (NULLFUNC, NULLPTR, YES, NO)
- use outb/inb directly
- use locking functions directly
- don't define another ROUNDUP, use roundup(x, 2) instead
- some comments and whitespace cleanup
- remove some commented crap
- prepend the rest by I2 prefix to not collide with rest of the world
like in following output (pointed out by akpm)
In file included from drivers/char/ip2/ip2main.c:128:
drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
In file included from include/net/netns/ipv4.h:8,
from include/net/net_namespace.h:13,
from include/linux/seq_file.h:7,
from include/asm/machdep.h:12,
from include/asm/pci.h:17,
from include/linux/pci.h:951,
from drivers/char/ip2/ip2main.c:95:
include/net/inet_frag.h:28:1: warning: this is the location of the previous definition
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ip2/ip2main.c')
-rw-r--r-- | drivers/char/ip2/ip2main.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 319f804fc4d6..c4f4ca31f7c0 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c @@ -1052,9 +1052,9 @@ set_irq( int boardnum, int boardIrq ) * Write to FIFO; don't bother to adjust fifo capacity for this, since * board will respond almost immediately after SendMail hit. */ - WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); + write_lock_irqsave(&pB->write_fifo_spinlock, flags); iiWriteBuf(pB, tempCommand, 4); - WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); + write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); pB->i2eUsingIrq = boardIrq; pB->i2eOutMailWaiting |= MB_OUT_STUFFED; @@ -1072,9 +1072,9 @@ set_irq( int boardnum, int boardIrq ) (CMD_OF(tempCommand))[4] = 64; // chars (CMD_OF(tempCommand))[5] = 87; // HW_TEST - WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); + write_lock_irqsave(&pB->write_fifo_spinlock, flags); iiWriteBuf(pB, tempCommand, 8); - WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); + write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); CHANNEL_OF(tempCommand) = 0; PTYPE_OF(tempCommand) = PTYPE_BYPASS; @@ -1089,9 +1089,9 @@ set_irq( int boardnum, int boardIrq ) CMD_COUNT_OF(tempCommand) = 2; (CMD_OF(tempCommand))[0] = 44; /* get ping */ (CMD_OF(tempCommand))[1] = 200; /* 200 ms */ - WRITE_LOCK_IRQSAVE(&pB->write_fifo_spinlock,flags); + write_lock_irqsave(&pB->write_fifo_spinlock, flags); iiWriteBuf(pB, tempCommand, 4); - WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags); + write_unlock_irqrestore(&pB->write_fifo_spinlock, flags); #endif iiEnableMailIrq(pB); @@ -1270,12 +1270,12 @@ static void do_input(struct work_struct *work) // Data input if ( pCh->pTTY != NULL ) { - READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) + read_lock_irqsave(&pCh->Ibuf_spinlock, flags); if (!pCh->throttled && (pCh->Ibuf_stuff != pCh->Ibuf_strip)) { - READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) + read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); i2Input( pCh ); } else - READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) + read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); } else { ip2trace(CHANN, ITRC_INPUT, 22, 0 ); @@ -1719,9 +1719,9 @@ ip2_write( PTTY tty, const unsigned char *pData, int count) ip2_flush_chars( tty ); /* This is the actual move bit. Make sure it does what we need!!!!! */ - WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + write_lock_irqsave(&pCh->Pbuf_spinlock, flags); bytesSent = i2Output( pCh, pData, count); - WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); ip2trace (CHANN, ITRC_WRITE, ITRC_RETURN, 1, bytesSent ); @@ -1746,13 +1746,13 @@ ip2_putchar( PTTY tty, unsigned char ch ) // ip2trace (CHANN, ITRC_PUTC, ITRC_ENTER, 1, ch ); - WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + write_lock_irqsave(&pCh->Pbuf_spinlock, flags); pCh->Pbuf[pCh->Pbuf_stuff++] = ch; if ( pCh->Pbuf_stuff == sizeof pCh->Pbuf ) { - WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); ip2_flush_chars( tty ); } else - WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); // ip2trace (CHANN, ITRC_PUTC, ITRC_RETURN, 1, ch ); } @@ -1772,7 +1772,7 @@ ip2_flush_chars( PTTY tty ) i2ChanStrPtr pCh = tty->driver_data; unsigned long flags; - WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + write_lock_irqsave(&pCh->Pbuf_spinlock, flags); if ( pCh->Pbuf_stuff ) { // ip2trace (CHANN, ITRC_PUTC, 10, 1, strip ); @@ -1786,7 +1786,7 @@ ip2_flush_chars( PTTY tty ) } pCh->Pbuf_stuff -= strip; } - WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); } /******************************************************************************/ @@ -1804,9 +1804,9 @@ ip2_write_room ( PTTY tty ) i2ChanStrPtr pCh = tty->driver_data; unsigned long flags; - READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + read_lock_irqsave(&pCh->Pbuf_spinlock, flags); bytesFree = i2OutputFree( pCh ) - pCh->Pbuf_stuff; - READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); ip2trace (CHANN, ITRC_WRITE, 11, 1, bytesFree ); @@ -1836,12 +1836,12 @@ ip2_chars_in_buf ( PTTY tty ) pCh->Obuf_char_count + pCh->Pbuf_stuff, pCh->Obuf_char_count, pCh->Pbuf_stuff ); #endif - READ_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags); + read_lock_irqsave(&pCh->Obuf_spinlock, flags); rc = pCh->Obuf_char_count; - READ_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags); - READ_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + read_unlock_irqrestore(&pCh->Obuf_spinlock, flags); + read_lock_irqsave(&pCh->Pbuf_spinlock, flags); rc += pCh->Pbuf_stuff; - READ_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + read_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); return rc; } @@ -1865,9 +1865,9 @@ ip2_flush_buffer( PTTY tty ) #ifdef IP2DEBUG_WRITE printk (KERN_DEBUG "IP2: flush buffer\n" ); #endif - WRITE_LOCK_IRQSAVE(&pCh->Pbuf_spinlock,flags); + write_lock_irqsave(&pCh->Pbuf_spinlock, flags); pCh->Pbuf_stuff = 0; - WRITE_UNLOCK_IRQRESTORE(&pCh->Pbuf_spinlock,flags); + write_unlock_irqrestore(&pCh->Pbuf_spinlock, flags); i2FlushOutput( pCh ); ip2_owake(tty); @@ -1953,15 +1953,15 @@ ip2_unthrottle ( PTTY tty ) pCh->throttled = 0; i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_RESUME); serviceOutgoingFifo( pCh->pMyBord ); - READ_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags) + read_lock_irqsave(&pCh->Ibuf_spinlock, flags); if ( pCh->Ibuf_stuff != pCh->Ibuf_strip ) { - READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) + read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); #ifdef IP2DEBUG_READ printk (KERN_DEBUG "i2Input called from unthrottle\n" ); #endif i2Input( pCh ); } else - READ_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags) + read_unlock_irqrestore(&pCh->Ibuf_spinlock, flags); } static void @@ -2204,9 +2204,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) * for masking). Caller should use TIOCGICOUNT to see which one it was */ case TIOCMIWAIT: - WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); + write_lock_irqsave(&pB->read_fifo_spinlock, flags); cprev = pCh->icount; /* note the counters on entry */ - WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); + write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); i2QueueCommands(PTYPE_BYPASS, pCh, 100, 4, CMD_DCD_REP, CMD_CTS_REP, CMD_DSR_REP, CMD_RI_REP); init_waitqueue_entry(&wait, current); @@ -2226,9 +2226,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) rc = -ERESTARTSYS; break; } - WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); + write_lock_irqsave(&pB->read_fifo_spinlock, flags); cnow = pCh->icount; /* atomic copy */ - WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); + write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr && cnow.dcd == cprev.dcd && cnow.cts == cprev.cts) { rc = -EIO; /* no change => rc */ @@ -2266,9 +2266,9 @@ ip2_ioctl ( PTTY tty, struct file *pFile, UINT cmd, ULONG arg ) case TIOCGICOUNT: ip2trace (CHANN, ITRC_IOCTL, 11, 1, rc ); - WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock, flags); + write_lock_irqsave(&pB->read_fifo_spinlock, flags); cnow = pCh->icount; - WRITE_UNLOCK_IRQRESTORE(&pB->read_fifo_spinlock, flags); + write_unlock_irqrestore(&pB->read_fifo_spinlock, flags); p_cuser = argp; rc = put_user(cnow.cts, &p_cuser->cts); rc = put_user(cnow.dsr, &p_cuser->dsr); @@ -2874,7 +2874,7 @@ ip2_ipl_ioctl ( struct inode *pInode, struct file *pFile, UINT cmd, ULONG arg ) case 65: /* Board - ip2stat */ if ( pB ) { rc = copy_to_user(argp, pB, sizeof(i2eBordStr)); - rc = put_user(INB(pB->i2eStatus), + rc = put_user(inb(pB->i2eStatus), (ULONG __user *)(arg + (ULONG)(&pB->i2eStatus) - (ULONG)pB ) ); } else { rc = -ENODEV; |