[PATCH 9/13] moxa: remove cli()/sti() in drivers/char/moxa.c

From: James Nelson
Date: Sun Jan 16 2005 - 09:09:33 EST


Signed-off-by: James Nelson <james4765@xxxxxxxxx>

diff -urN --exclude='*~' linux-2.6.11-rc1-mm1-original/drivers/char/moxa.c linux-2.6.11-rc1-mm1/drivers/char/moxa.c
--- linux-2.6.11-rc1-mm1-original/drivers/char/moxa.c 2004-12-24 16:35:28.000000000 -0500
+++ linux-2.6.11-rc1-mm1/drivers/char/moxa.c 2005-01-16 07:32:19.500529504 -0500
@@ -645,10 +645,9 @@
if (ch == NULL)
return (0);
port = ch->port;
- save_flags(flags);
- cli();
+ local_irq_save(flags);
len = MoxaPortWriteData(port, (unsigned char *) buf, count);
- restore_flags(flags);
+ local_irq_restore(flags);

/*********************************************
if ( !(ch->statusflags & LOWWAIT) &&
@@ -723,11 +722,10 @@
if (ch == NULL)
return;
port = ch->port;
- save_flags(flags);
- cli();
+ local_irq_save(flags);
moxaXmitBuff[0] = c;
MoxaPortWriteData(port, moxaXmitBuff, 1);
- restore_flags(flags);
+ local_irq_restore(flags);
/************************************************
if ( !(ch->statusflags & LOWWAIT) && (MoxaPortTxFree(port) <= 100) )
*************************************************/
@@ -1030,11 +1028,10 @@
printk("block_til_ready before block: ttys%d, count = %d\n",
ch->line, ch->count);
#endif
- save_flags(flags);
- cli();
+ local_irq_save(flags);
if (!tty_hung_up_p(filp))
ch->count--;
- restore_flags(flags);
+ local_irq_restore(flags);
ch->blocked_open++;
while (1) {
set_current_state(TASK_INTERRUPTIBLE);
@@ -1080,15 +1077,14 @@
struct moxa_str *ch = tty->driver_data;
unsigned long flags;

- save_flags(flags);
- cli();
+ local_irq_save(flags);
ch->statusflags |= EMPTYWAIT;
moxaEmptyTimer_on[ch->port] = 0;
del_timer(&moxaEmptyTimer[ch->port]);
moxaEmptyTimer[ch->port].expires = jiffies + HZ;
moxaEmptyTimer_on[ch->port] = 1;
add_timer(&moxaEmptyTimer[ch->port]);
- restore_flags(flags);
+ local_irq_restore(flags);
}

static void check_xmit_empty(unsigned long data)
@@ -1156,10 +1152,9 @@
charptr = tp->flip.char_buf_ptr;
flagptr = tp->flip.flag_buf_ptr;
rc = tp->flip.count;
- save_flags(flags);
- cli();
+ local_irq_save(flags);
count = MoxaPortReadData(ch->port, charptr, space);
- restore_flags(flags);
+ local_irq_restore(flags);
for (i = 0; i < count; i++)
*flagptr++ = 0;
charptr += count;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/