Commit 0fab6de0 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

synclink drivers bool conversion

Remove more TRUE/FALSE defines and uses
Remove == TRUE tests
Convert BOOLEAN to bool
Convert int to bool where appropriate
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarPaul Fulghum <paulkf@microgate.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7a63ce5a
This diff is collapsed.
This diff is collapsed.
...@@ -117,7 +117,7 @@ static struct pci_driver pci_driver = { ...@@ -117,7 +117,7 @@ static struct pci_driver pci_driver = {
.remove = __devexit_p(remove_one), .remove = __devexit_p(remove_one),
}; };
static int pci_registered; static bool pci_registered;
/* /*
* module configuration and status * module configuration and status
...@@ -289,12 +289,12 @@ struct slgt_info { ...@@ -289,12 +289,12 @@ struct slgt_info {
struct work_struct task; struct work_struct task;
u32 pending_bh; u32 pending_bh;
int bh_requested; bool bh_requested;
int bh_running; bool bh_running;
int isr_overflow; int isr_overflow;
int irq_requested; /* nonzero if IRQ requested */ bool irq_requested; /* true if IRQ requested */
int irq_occurred; /* for diagnostics use */ bool irq_occurred; /* for diagnostics use */
/* device configuration */ /* device configuration */
...@@ -304,7 +304,7 @@ struct slgt_info { ...@@ -304,7 +304,7 @@ struct slgt_info {
unsigned char __iomem * reg_addr; /* memory mapped registers address */ unsigned char __iomem * reg_addr; /* memory mapped registers address */
u32 phys_reg_addr; u32 phys_reg_addr;
int reg_addr_requested; bool reg_addr_requested;
MGSL_PARAMS params; /* communications parameters */ MGSL_PARAMS params; /* communications parameters */
u32 idle_mode; u32 idle_mode;
...@@ -315,11 +315,11 @@ struct slgt_info { ...@@ -315,11 +315,11 @@ struct slgt_info {
/* device status */ /* device status */
int rx_enabled; bool rx_enabled;
int rx_restart; bool rx_restart;
int tx_enabled; bool tx_enabled;
int tx_active; bool tx_active;
unsigned char signals; /* serial signal states */ unsigned char signals; /* serial signal states */
int init_error; /* initialization error */ int init_error; /* initialization error */
...@@ -329,7 +329,7 @@ struct slgt_info { ...@@ -329,7 +329,7 @@ struct slgt_info {
char flag_buf[MAX_ASYNC_BUFFER_SIZE]; char flag_buf[MAX_ASYNC_BUFFER_SIZE];
char char_buf[MAX_ASYNC_BUFFER_SIZE]; char char_buf[MAX_ASYNC_BUFFER_SIZE];
BOOLEAN drop_rts_on_tx_done; bool drop_rts_on_tx_done;
struct _input_signal_events input_signal_events; struct _input_signal_events input_signal_events;
int dcd_chkcount; /* check counts to prevent */ int dcd_chkcount; /* check counts to prevent */
...@@ -467,8 +467,8 @@ static void rx_start(struct slgt_info *info); ...@@ -467,8 +467,8 @@ static void rx_start(struct slgt_info *info);
static void reset_rbufs(struct slgt_info *info); static void reset_rbufs(struct slgt_info *info);
static void free_rbufs(struct slgt_info *info, unsigned int first, unsigned int last); static void free_rbufs(struct slgt_info *info, unsigned int first, unsigned int last);
static void rdma_reset(struct slgt_info *info); static void rdma_reset(struct slgt_info *info);
static int rx_get_frame(struct slgt_info *info); static bool rx_get_frame(struct slgt_info *info);
static int rx_get_buf(struct slgt_info *info); static bool rx_get_buf(struct slgt_info *info);
static void tx_start(struct slgt_info *info); static void tx_start(struct slgt_info *info);
static void tx_stop(struct slgt_info *info); static void tx_stop(struct slgt_info *info);
...@@ -1968,8 +1968,8 @@ static int bh_action(struct slgt_info *info) ...@@ -1968,8 +1968,8 @@ static int bh_action(struct slgt_info *info)
rc = BH_STATUS; rc = BH_STATUS;
} else { } else {
/* Mark BH routine as complete */ /* Mark BH routine as complete */
info->bh_running = 0; info->bh_running = false;
info->bh_requested = 0; info->bh_requested = false;
rc = 0; rc = 0;
} }
...@@ -1988,7 +1988,7 @@ static void bh_handler(struct work_struct *work) ...@@ -1988,7 +1988,7 @@ static void bh_handler(struct work_struct *work)
if (!info) if (!info)
return; return;
info->bh_running = 1; info->bh_running = true;
while((action = bh_action(info))) { while((action = bh_action(info))) {
switch (action) { switch (action) {
...@@ -2158,7 +2158,7 @@ static void isr_serial(struct slgt_info *info) ...@@ -2158,7 +2158,7 @@ static void isr_serial(struct slgt_info *info)
wr_reg16(info, SSR, status); /* clear pending */ wr_reg16(info, SSR, status); /* clear pending */
info->irq_occurred = 1; info->irq_occurred = true;
if (info->params.mode == MGSL_MODE_ASYNC) { if (info->params.mode == MGSL_MODE_ASYNC) {
if (status & IRQ_TXIDLE) { if (status & IRQ_TXIDLE) {
...@@ -2225,7 +2225,7 @@ static void isr_rdma(struct slgt_info *info) ...@@ -2225,7 +2225,7 @@ static void isr_rdma(struct slgt_info *info)
if (status & (BIT5 + BIT4)) { if (status & (BIT5 + BIT4)) {
DBGISR(("%s isr_rdma rx_restart=1\n", info->device_name)); DBGISR(("%s isr_rdma rx_restart=1\n", info->device_name));
info->rx_restart = 1; info->rx_restart = true;
} }
info->pending_bh |= BH_RECEIVE; info->pending_bh |= BH_RECEIVE;
} }
...@@ -2276,14 +2276,14 @@ static void isr_txeom(struct slgt_info *info, unsigned short status) ...@@ -2276,14 +2276,14 @@ static void isr_txeom(struct slgt_info *info, unsigned short status)
info->icount.txok++; info->icount.txok++;
} }
info->tx_active = 0; info->tx_active = false;
info->tx_count = 0; info->tx_count = 0;
del_timer(&info->tx_timer); del_timer(&info->tx_timer);
if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done) { if (info->params.mode != MGSL_MODE_ASYNC && info->drop_rts_on_tx_done) {
info->signals &= ~SerialSignal_RTS; info->signals &= ~SerialSignal_RTS;
info->drop_rts_on_tx_done = 0; info->drop_rts_on_tx_done = false;
set_signals(info); set_signals(info);
} }
...@@ -2337,7 +2337,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id) ...@@ -2337,7 +2337,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
while((gsr = rd_reg32(info, GSR) & 0xffffff00)) { while((gsr = rd_reg32(info, GSR) & 0xffffff00)) {
DBGISR(("%s gsr=%08x\n", info->device_name, gsr)); DBGISR(("%s gsr=%08x\n", info->device_name, gsr));
info->irq_occurred = 1; info->irq_occurred = true;
for(i=0; i < info->port_count ; i++) { for(i=0; i < info->port_count ; i++) {
if (info->port_array[i] == NULL) if (info->port_array[i] == NULL)
continue; continue;
...@@ -2374,7 +2374,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id) ...@@ -2374,7 +2374,7 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
!port->bh_requested) { !port->bh_requested) {
DBGISR(("%s bh queued\n", port->device_name)); DBGISR(("%s bh queued\n", port->device_name));
schedule_work(&port->task); schedule_work(&port->task);
port->bh_requested = 1; port->bh_requested = true;
} }
} }
...@@ -3110,7 +3110,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -3110,7 +3110,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
{ {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
int retval; int retval;
int do_clocal = 0, extra_count = 0; bool do_clocal = false;
bool extra_count = false;
unsigned long flags; unsigned long flags;
DBGINFO(("%s block_til_ready\n", tty->driver->name)); DBGINFO(("%s block_til_ready\n", tty->driver->name));
...@@ -3122,7 +3123,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -3122,7 +3123,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
} }
if (tty->termios->c_cflag & CLOCAL) if (tty->termios->c_cflag & CLOCAL)
do_clocal = 1; do_clocal = true;
/* Wait for carrier detect and the line to become /* Wait for carrier detect and the line to become
* free (i.e., not in use by the callout). While we are in * free (i.e., not in use by the callout). While we are in
...@@ -3136,7 +3137,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -3136,7 +3137,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
spin_lock_irqsave(&info->lock, flags); spin_lock_irqsave(&info->lock, flags);
if (!tty_hung_up_p(filp)) { if (!tty_hung_up_p(filp)) {
extra_count = 1; extra_count = true;
info->count--; info->count--;
} }
spin_unlock_irqrestore(&info->lock, flags); spin_unlock_irqrestore(&info->lock, flags);
...@@ -3321,7 +3322,7 @@ static int claim_resources(struct slgt_info *info) ...@@ -3321,7 +3322,7 @@ static int claim_resources(struct slgt_info *info)
goto errout; goto errout;
} }
else else
info->reg_addr_requested = 1; info->reg_addr_requested = true;
info->reg_addr = ioremap(info->phys_reg_addr, SLGT_REG_SIZE); info->reg_addr = ioremap(info->phys_reg_addr, SLGT_REG_SIZE);
if (!info->reg_addr) { if (!info->reg_addr) {
...@@ -3341,12 +3342,12 @@ static void release_resources(struct slgt_info *info) ...@@ -3341,12 +3342,12 @@ static void release_resources(struct slgt_info *info)
{ {
if (info->irq_requested) { if (info->irq_requested) {
free_irq(info->irq_level, info); free_irq(info->irq_level, info);
info->irq_requested = 0; info->irq_requested = false;
} }
if (info->reg_addr_requested) { if (info->reg_addr_requested) {
release_mem_region(info->phys_reg_addr, SLGT_REG_SIZE); release_mem_region(info->phys_reg_addr, SLGT_REG_SIZE);
info->reg_addr_requested = 0; info->reg_addr_requested = false;
} }
if (info->reg_addr) { if (info->reg_addr) {
...@@ -3511,7 +3512,7 @@ static void device_init(int adapter_num, struct pci_dev *pdev) ...@@ -3511,7 +3512,7 @@ static void device_init(int adapter_num, struct pci_dev *pdev)
port_array[0]->device_name, port_array[0]->device_name,
port_array[0]->irq_level)); port_array[0]->irq_level));
} else { } else {
port_array[0]->irq_requested = 1; port_array[0]->irq_requested = true;
adapter_test(port_array[0]); adapter_test(port_array[0]);
for (i=1 ; i < port_count ; i++) { for (i=1 ; i < port_count ; i++) {
port_array[i]->init_error = port_array[0]->init_error; port_array[i]->init_error = port_array[0]->init_error;
...@@ -3654,7 +3655,7 @@ static int __init slgt_init(void) ...@@ -3654,7 +3655,7 @@ static int __init slgt_init(void)
printk("%s pci_register_driver error=%d\n", driver_name, rc); printk("%s pci_register_driver error=%d\n", driver_name, rc);
goto error; goto error;
} }
pci_registered = 1; pci_registered = true;
if (!slgt_device_list) if (!slgt_device_list)
printk("%s no devices found\n",driver_name); printk("%s no devices found\n",driver_name);
...@@ -3812,8 +3813,8 @@ static void rx_stop(struct slgt_info *info) ...@@ -3812,8 +3813,8 @@ static void rx_stop(struct slgt_info *info)
rdma_reset(info); rdma_reset(info);
info->rx_enabled = 0; info->rx_enabled = false;
info->rx_restart = 0; info->rx_restart = false;
} }
static void rx_start(struct slgt_info *info) static void rx_start(struct slgt_info *info)
...@@ -3849,8 +3850,8 @@ static void rx_start(struct slgt_info *info) ...@@ -3849,8 +3850,8 @@ static void rx_start(struct slgt_info *info)
/* enable receiver */ /* enable receiver */
wr_reg16(info, RCR, (unsigned short)(rd_reg16(info, RCR) | BIT1)); wr_reg16(info, RCR, (unsigned short)(rd_reg16(info, RCR) | BIT1));
info->rx_restart = 0; info->rx_restart = false;
info->rx_enabled = 1; info->rx_enabled = true;
} }
static void tx_start(struct slgt_info *info) static void tx_start(struct slgt_info *info)
...@@ -3858,11 +3859,11 @@ static void tx_start(struct slgt_info *info) ...@@ -3858,11 +3859,11 @@ static void tx_start(struct slgt_info *info)
if (!info->tx_enabled) { if (!info->tx_enabled) {
wr_reg16(info, TCR, wr_reg16(info, TCR,
(unsigned short)((rd_reg16(info, TCR) | BIT1) & ~BIT2)); (unsigned short)((rd_reg16(info, TCR) | BIT1) & ~BIT2));
info->tx_enabled = TRUE; info->tx_enabled = true;
} }
if (info->tx_count) { if (info->tx_count) {
info->drop_rts_on_tx_done = 0; info->drop_rts_on_tx_done = false;
if (info->params.mode != MGSL_MODE_ASYNC) { if (info->params.mode != MGSL_MODE_ASYNC) {
if (info->params.flags & HDLC_FLAG_AUTO_RTS) { if (info->params.flags & HDLC_FLAG_AUTO_RTS) {
...@@ -3870,7 +3871,7 @@ static void tx_start(struct slgt_info *info) ...@@ -3870,7 +3871,7 @@ static void tx_start(struct slgt_info *info)
if (!(info->signals & SerialSignal_RTS)) { if (!(info->signals & SerialSignal_RTS)) {
info->signals |= SerialSignal_RTS; info->signals |= SerialSignal_RTS;
set_signals(info); set_signals(info);
info->drop_rts_on_tx_done = 1; info->drop_rts_on_tx_done = true;
} }
} }
...@@ -3888,7 +3889,7 @@ static void tx_start(struct slgt_info *info) ...@@ -3888,7 +3889,7 @@ static void tx_start(struct slgt_info *info)
wr_reg16(info, SSR, IRQ_TXIDLE); wr_reg16(info, SSR, IRQ_TXIDLE);
} }
tdma_start(info); tdma_start(info);
info->tx_active = 1; info->tx_active = true;
} }
} }
...@@ -3949,8 +3950,8 @@ static void tx_stop(struct slgt_info *info) ...@@ -3949,8 +3950,8 @@ static void tx_stop(struct slgt_info *info)
reset_tbufs(info); reset_tbufs(info);
info->tx_enabled = 0; info->tx_enabled = false;
info->tx_active = 0; info->tx_active = false;
} }
static void reset_port(struct slgt_info *info) static void reset_port(struct slgt_info *info)
...@@ -4470,14 +4471,13 @@ static void reset_rbufs(struct slgt_info *info) ...@@ -4470,14 +4471,13 @@ static void reset_rbufs(struct slgt_info *info)
/* /*
* pass receive HDLC frame to upper layer * pass receive HDLC frame to upper layer
* *
* return 1 if frame available, otherwise 0 * return true if frame available, otherwise false
*/ */
static int rx_get_frame(struct slgt_info *info) static bool rx_get_frame(struct slgt_info *info)
{ {
unsigned int start, end; unsigned int start, end;
unsigned short status; unsigned short status;
unsigned int framesize = 0; unsigned int framesize = 0;
int rc = 0;
unsigned long flags; unsigned long flags;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->tty;
unsigned char addr_field = 0xff; unsigned char addr_field = 0xff;
...@@ -4601,23 +4601,23 @@ check_again: ...@@ -4601,23 +4601,23 @@ check_again:
} }
} }
free_rbufs(info, start, end); free_rbufs(info, start, end);
rc = 1; return true;
cleanup: cleanup:
return rc; return false;
} }
/* /*
* pass receive buffer (RAW synchronous mode) to tty layer * pass receive buffer (RAW synchronous mode) to tty layer
* return 1 if buffer available, otherwise 0 * return true if buffer available, otherwise false
*/ */
static int rx_get_buf(struct slgt_info *info) static bool rx_get_buf(struct slgt_info *info)
{ {
unsigned int i = info->rbuf_current; unsigned int i = info->rbuf_current;
unsigned int count; unsigned int count;
if (!desc_complete(info->rbufs[i])) if (!desc_complete(info->rbufs[i]))
return 0; return false;
count = desc_count(info->rbufs[i]); count = desc_count(info->rbufs[i]);
switch(info->params.mode) { switch(info->params.mode) {
case MGSL_MODE_MONOSYNC: case MGSL_MODE_MONOSYNC:
...@@ -4633,7 +4633,7 @@ static int rx_get_buf(struct slgt_info *info) ...@@ -4633,7 +4633,7 @@ static int rx_get_buf(struct slgt_info *info)
ldisc_receive_buf(info->tty, info->rbufs[i].buf, ldisc_receive_buf(info->tty, info->rbufs[i].buf,
info->flag_buf, count); info->flag_buf, count);
free_rbufs(info, i, i); free_rbufs(info, i, i);
return 1; return true;
} }
static void reset_tbufs(struct slgt_info *info) static void reset_tbufs(struct slgt_info *info)
...@@ -4758,7 +4758,7 @@ static int irq_test(struct slgt_info *info) ...@@ -4758,7 +4758,7 @@ static int irq_test(struct slgt_info *info)
/* assume failure */ /* assume failure */
info->init_error = DiagStatus_IrqFailure; info->init_error = DiagStatus_IrqFailure;
info->irq_occurred = FALSE; info->irq_occurred = false;
spin_unlock_irqrestore(&info->lock, flags); spin_unlock_irqrestore(&info->lock, flags);
...@@ -4891,7 +4891,7 @@ static void tx_timeout(unsigned long context) ...@@ -4891,7 +4891,7 @@ static void tx_timeout(unsigned long context)
info->icount.txtimeout++; info->icount.txtimeout++;
} }
spin_lock_irqsave(&info->lock,flags); spin_lock_irqsave(&info->lock,flags);
info->tx_active = 0; info->tx_active = false;
info->tx_count = 0; info->tx_count = 0;
spin_unlock_irqrestore(&info->lock,flags); spin_unlock_irqrestore(&info->lock,flags);
......
This diff is collapsed.
...@@ -13,10 +13,6 @@ ...@@ -13,10 +13,6 @@
#define _SYNCLINK_H_ #define _SYNCLINK_H_
#define SYNCLINK_H_VERSION 3.6 #define SYNCLINK_H_VERSION 3.6
#define BOOLEAN int
#define TRUE 1
#define FALSE 0
#define BIT0 0x0001 #define BIT0 0x0001
#define BIT1 0x0002 #define BIT1 0x0002
#define BIT2 0x0004 #define BIT2 0x0004
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment