diff options
author | Joe Perches <joe@perches.com> | 2008-04-28 05:14:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:29 -0400 |
commit | 0fab6de09c71a976e5d765e1ff548b14be385153 (patch) | |
tree | 74782032b89218366fc999f570c01e7d6a105be6 /drivers/char/pcmcia | |
parent | 7a63ce5a1f2fde5ae737f059e2714e441447120c (diff) |
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: Joe Perches <joe@perches.com>
Acked-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/pcmcia')
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 125 |
1 files changed, 63 insertions, 62 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 4e84d233e5a2..583356426dfb 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -189,20 +189,20 @@ typedef struct _mgslpc_info { | |||
189 | 189 | ||
190 | u32 pending_bh; | 190 | u32 pending_bh; |
191 | 191 | ||
192 | int bh_running; | 192 | bool bh_running; |
193 | int bh_requested; | 193 | bool bh_requested; |
194 | 194 | ||
195 | int dcd_chkcount; /* check counts to prevent */ | 195 | int dcd_chkcount; /* check counts to prevent */ |
196 | int cts_chkcount; /* too many IRQs if a signal */ | 196 | int cts_chkcount; /* too many IRQs if a signal */ |
197 | int dsr_chkcount; /* is floating */ | 197 | int dsr_chkcount; /* is floating */ |
198 | int ri_chkcount; | 198 | int ri_chkcount; |
199 | 199 | ||
200 | int rx_enabled; | 200 | bool rx_enabled; |
201 | int rx_overflow; | 201 | bool rx_overflow; |
202 | 202 | ||
203 | int tx_enabled; | 203 | bool tx_enabled; |
204 | int tx_active; | 204 | bool tx_active; |
205 | int tx_aborting; | 205 | bool tx_aborting; |
206 | u32 idle_mode; | 206 | u32 idle_mode; |
207 | 207 | ||
208 | int if_mode; /* serial interface selection (RS-232, v.35 etc) */ | 208 | int if_mode; /* serial interface selection (RS-232, v.35 etc) */ |
@@ -216,12 +216,12 @@ typedef struct _mgslpc_info { | |||
216 | 216 | ||
217 | unsigned char serial_signals; /* current serial signal states */ | 217 | unsigned char serial_signals; /* current serial signal states */ |
218 | 218 | ||
219 | char irq_occurred; /* for diagnostics use */ | 219 | bool irq_occurred; /* for diagnostics use */ |
220 | char testing_irq; | 220 | char testing_irq; |
221 | unsigned int init_error; /* startup error (DIAGS) */ | 221 | unsigned int init_error; /* startup error (DIAGS) */ |
222 | 222 | ||
223 | char flag_buf[MAX_ASYNC_BUFFER_SIZE]; | 223 | char flag_buf[MAX_ASYNC_BUFFER_SIZE]; |
224 | BOOLEAN drop_rts_on_tx_done; | 224 | bool drop_rts_on_tx_done; |
225 | 225 | ||
226 | struct _input_signal_events input_signal_events; | 226 | struct _input_signal_events input_signal_events; |
227 | 227 | ||
@@ -402,8 +402,8 @@ static void hdlcdev_exit(MGSLPC_INFO *info); | |||
402 | 402 | ||
403 | static void trace_block(MGSLPC_INFO *info,const char* data, int count, int xmit); | 403 | static void trace_block(MGSLPC_INFO *info,const char* data, int count, int xmit); |
404 | 404 | ||
405 | static BOOLEAN register_test(MGSLPC_INFO *info); | 405 | static bool register_test(MGSLPC_INFO *info); |
406 | static BOOLEAN irq_test(MGSLPC_INFO *info); | 406 | static bool irq_test(MGSLPC_INFO *info); |
407 | static int adapter_test(MGSLPC_INFO *info); | 407 | static int adapter_test(MGSLPC_INFO *info); |
408 | 408 | ||
409 | static int claim_resources(MGSLPC_INFO *info); | 409 | static int claim_resources(MGSLPC_INFO *info); |
@@ -411,7 +411,7 @@ static void release_resources(MGSLPC_INFO *info); | |||
411 | static void mgslpc_add_device(MGSLPC_INFO *info); | 411 | static void mgslpc_add_device(MGSLPC_INFO *info); |
412 | static void mgslpc_remove_device(MGSLPC_INFO *info); | 412 | static void mgslpc_remove_device(MGSLPC_INFO *info); |
413 | 413 | ||
414 | static int rx_get_frame(MGSLPC_INFO *info); | 414 | static bool rx_get_frame(MGSLPC_INFO *info); |
415 | static void rx_reset_buffers(MGSLPC_INFO *info); | 415 | static void rx_reset_buffers(MGSLPC_INFO *info); |
416 | static int rx_alloc_buffers(MGSLPC_INFO *info); | 416 | static int rx_alloc_buffers(MGSLPC_INFO *info); |
417 | static void rx_free_buffers(MGSLPC_INFO *info); | 417 | static void rx_free_buffers(MGSLPC_INFO *info); |
@@ -719,7 +719,7 @@ static int mgslpc_resume(struct pcmcia_device *link) | |||
719 | } | 719 | } |
720 | 720 | ||
721 | 721 | ||
722 | static inline int mgslpc_paranoia_check(MGSLPC_INFO *info, | 722 | static inline bool mgslpc_paranoia_check(MGSLPC_INFO *info, |
723 | char *name, const char *routine) | 723 | char *name, const char *routine) |
724 | { | 724 | { |
725 | #ifdef MGSLPC_PARANOIA_CHECK | 725 | #ifdef MGSLPC_PARANOIA_CHECK |
@@ -730,17 +730,17 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info, | |||
730 | 730 | ||
731 | if (!info) { | 731 | if (!info) { |
732 | printk(badinfo, name, routine); | 732 | printk(badinfo, name, routine); |
733 | return 1; | 733 | return true; |
734 | } | 734 | } |
735 | if (info->magic != MGSLPC_MAGIC) { | 735 | if (info->magic != MGSLPC_MAGIC) { |
736 | printk(badmagic, name, routine); | 736 | printk(badmagic, name, routine); |
737 | return 1; | 737 | return true; |
738 | } | 738 | } |
739 | #else | 739 | #else |
740 | if (!info) | 740 | if (!info) |
741 | return 1; | 741 | return true; |
742 | #endif | 742 | #endif |
743 | return 0; | 743 | return false; |
744 | } | 744 | } |
745 | 745 | ||
746 | 746 | ||
@@ -752,16 +752,16 @@ static inline int mgslpc_paranoia_check(MGSLPC_INFO *info, | |||
752 | #define CMD_TXEOM BIT1 // transmit end message | 752 | #define CMD_TXEOM BIT1 // transmit end message |
753 | #define CMD_TXRESET BIT0 // transmit reset | 753 | #define CMD_TXRESET BIT0 // transmit reset |
754 | 754 | ||
755 | static BOOLEAN wait_command_complete(MGSLPC_INFO *info, unsigned char channel) | 755 | static bool wait_command_complete(MGSLPC_INFO *info, unsigned char channel) |
756 | { | 756 | { |
757 | int i = 0; | 757 | int i = 0; |
758 | /* wait for command completion */ | 758 | /* wait for command completion */ |
759 | while (read_reg(info, (unsigned char)(channel+STAR)) & BIT2) { | 759 | while (read_reg(info, (unsigned char)(channel+STAR)) & BIT2) { |
760 | udelay(1); | 760 | udelay(1); |
761 | if (i++ == 1000) | 761 | if (i++ == 1000) |
762 | return FALSE; | 762 | return false; |
763 | } | 763 | } |
764 | return TRUE; | 764 | return true; |
765 | } | 765 | } |
766 | 766 | ||
767 | static void issue_command(MGSLPC_INFO *info, unsigned char channel, unsigned char cmd) | 767 | static void issue_command(MGSLPC_INFO *info, unsigned char channel, unsigned char cmd) |
@@ -825,8 +825,8 @@ static int bh_action(MGSLPC_INFO *info) | |||
825 | 825 | ||
826 | if (!rc) { | 826 | if (!rc) { |
827 | /* Mark BH routine as complete */ | 827 | /* Mark BH routine as complete */ |
828 | info->bh_running = 0; | 828 | info->bh_running = false; |
829 | info->bh_requested = 0; | 829 | info->bh_requested = false; |
830 | } | 830 | } |
831 | 831 | ||
832 | spin_unlock_irqrestore(&info->lock,flags); | 832 | spin_unlock_irqrestore(&info->lock,flags); |
@@ -846,7 +846,7 @@ static void bh_handler(struct work_struct *work) | |||
846 | printk( "%s(%d):bh_handler(%s) entry\n", | 846 | printk( "%s(%d):bh_handler(%s) entry\n", |
847 | __FILE__,__LINE__,info->device_name); | 847 | __FILE__,__LINE__,info->device_name); |
848 | 848 | ||
849 | info->bh_running = 1; | 849 | info->bh_running = true; |
850 | 850 | ||
851 | while((action = bh_action(info)) != 0) { | 851 | while((action = bh_action(info)) != 0) { |
852 | 852 | ||
@@ -913,7 +913,7 @@ static void rx_ready_hdlc(MGSLPC_INFO *info, int eom) | |||
913 | /* no more free buffers */ | 913 | /* no more free buffers */ |
914 | issue_command(info, CHA, CMD_RXRESET); | 914 | issue_command(info, CHA, CMD_RXRESET); |
915 | info->pending_bh |= BH_RECEIVE; | 915 | info->pending_bh |= BH_RECEIVE; |
916 | info->rx_overflow = 1; | 916 | info->rx_overflow = true; |
917 | info->icount.buf_overrun++; | 917 | info->icount.buf_overrun++; |
918 | return; | 918 | return; |
919 | } | 919 | } |
@@ -1032,8 +1032,8 @@ static void tx_done(MGSLPC_INFO *info) | |||
1032 | if (!info->tx_active) | 1032 | if (!info->tx_active) |
1033 | return; | 1033 | return; |
1034 | 1034 | ||
1035 | info->tx_active = 0; | 1035 | info->tx_active = false; |
1036 | info->tx_aborting = 0; | 1036 | info->tx_aborting = false; |
1037 | 1037 | ||
1038 | if (info->params.mode == MGSL_MODE_ASYNC) | 1038 | if (info->params.mode == MGSL_MODE_ASYNC) |
1039 | return; | 1039 | return; |
@@ -1047,7 +1047,7 @@ static void tx_done(MGSLPC_INFO *info) | |||
1047 | info->serial_signals &= ~SerialSignal_RTS; | 1047 | info->serial_signals &= ~SerialSignal_RTS; |
1048 | set_signals(info); | 1048 | set_signals(info); |
1049 | } | 1049 | } |
1050 | info->drop_rts_on_tx_done = 0; | 1050 | info->drop_rts_on_tx_done = false; |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | #if SYNCLINK_GENERIC_HDLC | 1053 | #if SYNCLINK_GENERIC_HDLC |
@@ -1081,7 +1081,7 @@ static void tx_ready(MGSLPC_INFO *info) | |||
1081 | return; | 1081 | return; |
1082 | } | 1082 | } |
1083 | if (!info->tx_count) | 1083 | if (!info->tx_count) |
1084 | info->tx_active = 0; | 1084 | info->tx_active = false; |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | if (!info->tx_count) | 1087 | if (!info->tx_count) |
@@ -1261,7 +1261,7 @@ static irqreturn_t mgslpc_isr(int dummy, void *dev_id) | |||
1261 | { | 1261 | { |
1262 | isr = read_reg16(info, CHA + ISR); | 1262 | isr = read_reg16(info, CHA + ISR); |
1263 | if (isr & IRQ_TIMER) { | 1263 | if (isr & IRQ_TIMER) { |
1264 | info->irq_occurred = 1; | 1264 | info->irq_occurred = true; |
1265 | irq_disable(info, CHA, IRQ_TIMER); | 1265 | irq_disable(info, CHA, IRQ_TIMER); |
1266 | } | 1266 | } |
1267 | 1267 | ||
@@ -1318,7 +1318,7 @@ static irqreturn_t mgslpc_isr(int dummy, void *dev_id) | |||
1318 | printk("%s(%d):%s queueing bh task.\n", | 1318 | printk("%s(%d):%s queueing bh task.\n", |
1319 | __FILE__,__LINE__,info->device_name); | 1319 | __FILE__,__LINE__,info->device_name); |
1320 | schedule_work(&info->task); | 1320 | schedule_work(&info->task); |
1321 | info->bh_requested = 1; | 1321 | info->bh_requested = true; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | spin_unlock(&info->lock); | 1324 | spin_unlock(&info->lock); |
@@ -1990,7 +1990,7 @@ static int tx_abort(MGSLPC_INFO * info) | |||
1990 | * This results in underrun and abort transmission. | 1990 | * This results in underrun and abort transmission. |
1991 | */ | 1991 | */ |
1992 | info->tx_count = info->tx_put = info->tx_get = 0; | 1992 | info->tx_count = info->tx_put = info->tx_get = 0; |
1993 | info->tx_aborting = TRUE; | 1993 | info->tx_aborting = true; |
1994 | } | 1994 | } |
1995 | spin_unlock_irqrestore(&info->lock,flags); | 1995 | spin_unlock_irqrestore(&info->lock,flags); |
1996 | return 0; | 1996 | return 0; |
@@ -2589,7 +2589,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2589 | { | 2589 | { |
2590 | DECLARE_WAITQUEUE(wait, current); | 2590 | DECLARE_WAITQUEUE(wait, current); |
2591 | int retval; | 2591 | int retval; |
2592 | int do_clocal = 0, extra_count = 0; | 2592 | bool do_clocal = false; |
2593 | bool extra_count = false; | ||
2593 | unsigned long flags; | 2594 | unsigned long flags; |
2594 | 2595 | ||
2595 | if (debug_level >= DEBUG_LEVEL_INFO) | 2596 | if (debug_level >= DEBUG_LEVEL_INFO) |
@@ -2604,7 +2605,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2604 | } | 2605 | } |
2605 | 2606 | ||
2606 | if (tty->termios->c_cflag & CLOCAL) | 2607 | if (tty->termios->c_cflag & CLOCAL) |
2607 | do_clocal = 1; | 2608 | do_clocal = true; |
2608 | 2609 | ||
2609 | /* Wait for carrier detect and the line to become | 2610 | /* Wait for carrier detect and the line to become |
2610 | * free (i.e., not in use by the callout). While we are in | 2611 | * free (i.e., not in use by the callout). While we are in |
@@ -2622,7 +2623,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
2622 | 2623 | ||
2623 | spin_lock_irqsave(&info->lock, flags); | 2624 | spin_lock_irqsave(&info->lock, flags); |
2624 | if (!tty_hung_up_p(filp)) { | 2625 | if (!tty_hung_up_p(filp)) { |
2625 | extra_count = 1; | 2626 | extra_count = true; |
2626 | info->count--; | 2627 | info->count--; |
2627 | } | 2628 | } |
2628 | spin_unlock_irqrestore(&info->lock, flags); | 2629 | spin_unlock_irqrestore(&info->lock, flags); |
@@ -3493,8 +3494,8 @@ static void rx_stop(MGSLPC_INFO *info) | |||
3493 | /* MODE:03 RAC Receiver Active, 0=inactive */ | 3494 | /* MODE:03 RAC Receiver Active, 0=inactive */ |
3494 | clear_reg_bits(info, CHA + MODE, BIT3); | 3495 | clear_reg_bits(info, CHA + MODE, BIT3); |
3495 | 3496 | ||
3496 | info->rx_enabled = 0; | 3497 | info->rx_enabled = false; |
3497 | info->rx_overflow = 0; | 3498 | info->rx_overflow = false; |
3498 | } | 3499 | } |
3499 | 3500 | ||
3500 | static void rx_start(MGSLPC_INFO *info) | 3501 | static void rx_start(MGSLPC_INFO *info) |
@@ -3504,13 +3505,13 @@ static void rx_start(MGSLPC_INFO *info) | |||
3504 | __FILE__,__LINE__, info->device_name ); | 3505 | __FILE__,__LINE__, info->device_name ); |
3505 | 3506 | ||
3506 | rx_reset_buffers(info); | 3507 | rx_reset_buffers(info); |
3507 | info->rx_enabled = 0; | 3508 | info->rx_enabled = false; |
3508 | info->rx_overflow = 0; | 3509 | info->rx_overflow = false; |
3509 | 3510 | ||
3510 | /* MODE:03 RAC Receiver Active, 1=active */ | 3511 | /* MODE:03 RAC Receiver Active, 1=active */ |
3511 | set_reg_bits(info, CHA + MODE, BIT3); | 3512 | set_reg_bits(info, CHA + MODE, BIT3); |
3512 | 3513 | ||
3513 | info->rx_enabled = 1; | 3514 | info->rx_enabled = true; |
3514 | } | 3515 | } |
3515 | 3516 | ||
3516 | static void tx_start(MGSLPC_INFO *info) | 3517 | static void tx_start(MGSLPC_INFO *info) |
@@ -3523,24 +3524,24 @@ static void tx_start(MGSLPC_INFO *info) | |||
3523 | /* If auto RTS enabled and RTS is inactive, then assert */ | 3524 | /* If auto RTS enabled and RTS is inactive, then assert */ |
3524 | /* RTS and set a flag indicating that the driver should */ | 3525 | /* RTS and set a flag indicating that the driver should */ |
3525 | /* negate RTS when the transmission completes. */ | 3526 | /* negate RTS when the transmission completes. */ |
3526 | info->drop_rts_on_tx_done = 0; | 3527 | info->drop_rts_on_tx_done = false; |
3527 | 3528 | ||
3528 | if (info->params.flags & HDLC_FLAG_AUTO_RTS) { | 3529 | if (info->params.flags & HDLC_FLAG_AUTO_RTS) { |
3529 | get_signals(info); | 3530 | get_signals(info); |
3530 | if (!(info->serial_signals & SerialSignal_RTS)) { | 3531 | if (!(info->serial_signals & SerialSignal_RTS)) { |
3531 | info->serial_signals |= SerialSignal_RTS; | 3532 | info->serial_signals |= SerialSignal_RTS; |
3532 | set_signals(info); | 3533 | set_signals(info); |
3533 | info->drop_rts_on_tx_done = 1; | 3534 | info->drop_rts_on_tx_done = true; |
3534 | } | 3535 | } |
3535 | } | 3536 | } |
3536 | 3537 | ||
3537 | if (info->params.mode == MGSL_MODE_ASYNC) { | 3538 | if (info->params.mode == MGSL_MODE_ASYNC) { |
3538 | if (!info->tx_active) { | 3539 | if (!info->tx_active) { |
3539 | info->tx_active = 1; | 3540 | info->tx_active = true; |
3540 | tx_ready(info); | 3541 | tx_ready(info); |
3541 | } | 3542 | } |
3542 | } else { | 3543 | } else { |
3543 | info->tx_active = 1; | 3544 | info->tx_active = true; |
3544 | tx_ready(info); | 3545 | tx_ready(info); |
3545 | mod_timer(&info->tx_timer, jiffies + | 3546 | mod_timer(&info->tx_timer, jiffies + |
3546 | msecs_to_jiffies(5000)); | 3547 | msecs_to_jiffies(5000)); |
@@ -3548,7 +3549,7 @@ static void tx_start(MGSLPC_INFO *info) | |||
3548 | } | 3549 | } |
3549 | 3550 | ||
3550 | if (!info->tx_enabled) | 3551 | if (!info->tx_enabled) |
3551 | info->tx_enabled = 1; | 3552 | info->tx_enabled = true; |
3552 | } | 3553 | } |
3553 | 3554 | ||
3554 | static void tx_stop(MGSLPC_INFO *info) | 3555 | static void tx_stop(MGSLPC_INFO *info) |
@@ -3559,8 +3560,8 @@ static void tx_stop(MGSLPC_INFO *info) | |||
3559 | 3560 | ||
3560 | del_timer(&info->tx_timer); | 3561 | del_timer(&info->tx_timer); |
3561 | 3562 | ||
3562 | info->tx_enabled = 0; | 3563 | info->tx_enabled = false; |
3563 | info->tx_active = 0; | 3564 | info->tx_active = false; |
3564 | } | 3565 | } |
3565 | 3566 | ||
3566 | /* Reset the adapter to a known state and prepare it for further use. | 3567 | /* Reset the adapter to a known state and prepare it for further use. |
@@ -3860,19 +3861,19 @@ static void rx_reset_buffers(MGSLPC_INFO *info) | |||
3860 | /* Attempt to return a received HDLC frame | 3861 | /* Attempt to return a received HDLC frame |
3861 | * Only frames received without errors are returned. | 3862 | * Only frames received without errors are returned. |
3862 | * | 3863 | * |
3863 | * Returns 1 if frame returned, otherwise 0 | 3864 | * Returns true if frame returned, otherwise false |
3864 | */ | 3865 | */ |
3865 | static int rx_get_frame(MGSLPC_INFO *info) | 3866 | static bool rx_get_frame(MGSLPC_INFO *info) |
3866 | { | 3867 | { |
3867 | unsigned short status; | 3868 | unsigned short status; |
3868 | RXBUF *buf; | 3869 | RXBUF *buf; |
3869 | unsigned int framesize = 0; | 3870 | unsigned int framesize = 0; |
3870 | unsigned long flags; | 3871 | unsigned long flags; |
3871 | struct tty_struct *tty = info->tty; | 3872 | struct tty_struct *tty = info->tty; |
3872 | int return_frame = 0; | 3873 | bool return_frame = false; |
3873 | 3874 | ||
3874 | if (info->rx_frame_count == 0) | 3875 | if (info->rx_frame_count == 0) |
3875 | return 0; | 3876 | return false; |
3876 | 3877 | ||
3877 | buf = (RXBUF*)(info->rx_buf + (info->rx_get * info->rx_buf_size)); | 3878 | buf = (RXBUF*)(info->rx_buf + (info->rx_get * info->rx_buf_size)); |
3878 | 3879 | ||
@@ -3891,7 +3892,7 @@ static int rx_get_frame(MGSLPC_INFO *info) | |||
3891 | else if (!(status & BIT5)) { | 3892 | else if (!(status & BIT5)) { |
3892 | info->icount.rxcrc++; | 3893 | info->icount.rxcrc++; |
3893 | if (info->params.crc_type & HDLC_CRC_RETURN_EX) | 3894 | if (info->params.crc_type & HDLC_CRC_RETURN_EX) |
3894 | return_frame = 1; | 3895 | return_frame = true; |
3895 | } | 3896 | } |
3896 | framesize = 0; | 3897 | framesize = 0; |
3897 | #if SYNCLINK_GENERIC_HDLC | 3898 | #if SYNCLINK_GENERIC_HDLC |
@@ -3902,7 +3903,7 @@ static int rx_get_frame(MGSLPC_INFO *info) | |||
3902 | } | 3903 | } |
3903 | #endif | 3904 | #endif |
3904 | } else | 3905 | } else |
3905 | return_frame = 1; | 3906 | return_frame = true; |
3906 | 3907 | ||
3907 | if (return_frame) | 3908 | if (return_frame) |
3908 | framesize = buf->count; | 3909 | framesize = buf->count; |
@@ -3945,16 +3946,16 @@ static int rx_get_frame(MGSLPC_INFO *info) | |||
3945 | info->rx_get = 0; | 3946 | info->rx_get = 0; |
3946 | spin_unlock_irqrestore(&info->lock,flags); | 3947 | spin_unlock_irqrestore(&info->lock,flags); |
3947 | 3948 | ||
3948 | return 1; | 3949 | return true; |
3949 | } | 3950 | } |
3950 | 3951 | ||
3951 | static BOOLEAN register_test(MGSLPC_INFO *info) | 3952 | static bool register_test(MGSLPC_INFO *info) |
3952 | { | 3953 | { |
3953 | static unsigned char patterns[] = | 3954 | static unsigned char patterns[] = |
3954 | { 0x00, 0xff, 0xaa, 0x55, 0x69, 0x96, 0x0f }; | 3955 | { 0x00, 0xff, 0xaa, 0x55, 0x69, 0x96, 0x0f }; |
3955 | static unsigned int count = ARRAY_SIZE(patterns); | 3956 | static unsigned int count = ARRAY_SIZE(patterns); |
3956 | unsigned int i; | 3957 | unsigned int i; |
3957 | BOOLEAN rc = TRUE; | 3958 | bool rc = true; |
3958 | unsigned long flags; | 3959 | unsigned long flags; |
3959 | 3960 | ||
3960 | spin_lock_irqsave(&info->lock,flags); | 3961 | spin_lock_irqsave(&info->lock,flags); |
@@ -3965,7 +3966,7 @@ static BOOLEAN register_test(MGSLPC_INFO *info) | |||
3965 | write_reg(info, XAD2, patterns[(i + 1) % count]); | 3966 | write_reg(info, XAD2, patterns[(i + 1) % count]); |
3966 | if ((read_reg(info, XAD1) != patterns[i]) || | 3967 | if ((read_reg(info, XAD1) != patterns[i]) || |
3967 | (read_reg(info, XAD2) != patterns[(i + 1) % count])) { | 3968 | (read_reg(info, XAD2) != patterns[(i + 1) % count])) { |
3968 | rc = FALSE; | 3969 | rc = false; |
3969 | break; | 3970 | break; |
3970 | } | 3971 | } |
3971 | } | 3972 | } |
@@ -3974,7 +3975,7 @@ static BOOLEAN register_test(MGSLPC_INFO *info) | |||
3974 | return rc; | 3975 | return rc; |
3975 | } | 3976 | } |
3976 | 3977 | ||
3977 | static BOOLEAN irq_test(MGSLPC_INFO *info) | 3978 | static bool irq_test(MGSLPC_INFO *info) |
3978 | { | 3979 | { |
3979 | unsigned long end_time; | 3980 | unsigned long end_time; |
3980 | unsigned long flags; | 3981 | unsigned long flags; |
@@ -3982,10 +3983,10 @@ static BOOLEAN irq_test(MGSLPC_INFO *info) | |||
3982 | spin_lock_irqsave(&info->lock,flags); | 3983 | spin_lock_irqsave(&info->lock,flags); |
3983 | reset_device(info); | 3984 | reset_device(info); |
3984 | 3985 | ||
3985 | info->testing_irq = TRUE; | 3986 | info->testing_irq = true; |
3986 | hdlc_mode(info); | 3987 | hdlc_mode(info); |
3987 | 3988 | ||
3988 | info->irq_occurred = FALSE; | 3989 | info->irq_occurred = false; |
3989 | 3990 | ||
3990 | /* init hdlc mode */ | 3991 | /* init hdlc mode */ |
3991 | 3992 | ||
@@ -4000,13 +4001,13 @@ static BOOLEAN irq_test(MGSLPC_INFO *info) | |||
4000 | msleep_interruptible(10); | 4001 | msleep_interruptible(10); |
4001 | } | 4002 | } |
4002 | 4003 | ||
4003 | info->testing_irq = FALSE; | 4004 | info->testing_irq = false; |
4004 | 4005 | ||
4005 | spin_lock_irqsave(&info->lock,flags); | 4006 | spin_lock_irqsave(&info->lock,flags); |
4006 | reset_device(info); | 4007 | reset_device(info); |
4007 | spin_unlock_irqrestore(&info->lock,flags); | 4008 | spin_unlock_irqrestore(&info->lock,flags); |
4008 | 4009 | ||
4009 | return info->irq_occurred ? TRUE : FALSE; | 4010 | return info->irq_occurred; |
4010 | } | 4011 | } |
4011 | 4012 | ||
4012 | static int adapter_test(MGSLPC_INFO *info) | 4013 | static int adapter_test(MGSLPC_INFO *info) |
@@ -4079,7 +4080,7 @@ static void tx_timeout(unsigned long context) | |||
4079 | info->icount.txtimeout++; | 4080 | info->icount.txtimeout++; |
4080 | } | 4081 | } |
4081 | spin_lock_irqsave(&info->lock,flags); | 4082 | spin_lock_irqsave(&info->lock,flags); |
4082 | info->tx_active = 0; | 4083 | info->tx_active = false; |
4083 | info->tx_count = info->tx_put = info->tx_get = 0; | 4084 | info->tx_count = info->tx_put = info->tx_get = 0; |
4084 | 4085 | ||
4085 | spin_unlock_irqrestore(&info->lock,flags); | 4086 | spin_unlock_irqrestore(&info->lock,flags); |