[PATCH] char/isicom: More whitespaces and coding style

Wrap all the code to 80 chars on a line.
`}\nelse' changed to `} else'.
Clean whitespaces in header file.

Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jiri Slaby and committed by
Linus Torvalds
a547dfe9 e65c1db1

+69 -64
+59 -53
drivers/char/isicom.c
··· 189 189 unsigned char irq; 190 190 unsigned char port_count; 191 191 unsigned short status; 192 - unsigned short port_status; /* each bit represents a single port */ 192 + unsigned short port_status; /* each bit for each port */ 193 193 unsigned short shift_count; 194 194 struct isi_port * ports; 195 195 signed char count; ··· 242 242 udelay(1000); /* 1ms */ 243 243 } 244 244 } 245 - printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", card->base); 245 + printk(KERN_WARNING "ISICOM: Failed to lock Card (0x%lx)\n", 246 + card->base); 247 + 246 248 return 0; /* Failed to aquire the card! */ 247 249 } 248 250 ··· 468 466 residue = NO; 469 467 wrd = 0; 470 468 while (1) { 471 - cnt = min_t(int, txcount, (SERIAL_XMIT_SIZE - port->xmit_tail)); 469 + cnt = min_t(int, txcount, (SERIAL_XMIT_SIZE 470 + - port->xmit_tail)); 472 471 if (residue == YES) { 473 472 residue = NO; 474 473 if (cnt > 0) { 475 - wrd |= (port->xmit_buf[port->xmit_tail] << 8); 476 - port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1); 474 + wrd |= (port->xmit_buf[port->xmit_tail] 475 + << 8); 476 + port->xmit_tail = (port->xmit_tail + 1) 477 + & (SERIAL_XMIT_SIZE - 1); 477 478 port->xmit_cnt--; 478 479 txcount--; 479 480 cnt--; 480 481 outw(wrd, base); 481 - } 482 - else { 482 + } else { 483 483 outw(wrd, base); 484 484 break; 485 485 } 486 486 } 487 487 if (cnt <= 0) break; 488 488 word_count = cnt >> 1; 489 - outsw(base, port->xmit_buf+port->xmit_tail, word_count); 490 - port->xmit_tail = (port->xmit_tail + (word_count << 1)) & 491 - (SERIAL_XMIT_SIZE - 1); 489 + outsw(base, port->xmit_buf+port->xmit_tail,word_count); 490 + port->xmit_tail = (port->xmit_tail 491 + + (word_count << 1)) & (SERIAL_XMIT_SIZE - 1); 492 492 txcount -= (word_count << 1); 493 493 port->xmit_cnt -= (word_count << 1); 494 494 if (cnt & 0x0001) { 495 495 residue = YES; 496 496 wrd = port->xmit_buf[port->xmit_tail]; 497 - port->xmit_tail = (port->xmit_tail + 1) & (SERIAL_XMIT_SIZE - 1); 497 + port->xmit_tail = (port->xmit_tail + 1) 498 + & (SERIAL_XMIT_SIZE - 1); 498 499 port->xmit_cnt--; 499 500 txcount--; 500 501 } ··· 577 572 byte_count = header & 0xff; 578 573 579 574 if (channel + 1 > card->port_count) { 580 - printk(KERN_WARNING "ISICOM: isicom_interrupt(0x%lx): %d(channel) > port_count.\n", 581 - base, channel+1); 575 + printk(KERN_WARNING "ISICOM: isicom_interrupt(0x%lx): " 576 + "%d(channel) > port_count.\n", base, channel+1); 582 577 if (card->isa) 583 578 ClearInterrupt(base); 584 579 else ··· 616 611 header = inw(base); 617 612 switch(header & 0xff) { 618 613 case 0: /* Change in EIA signals */ 619 - 620 614 if (port->flags & ASYNC_CHECK_CD) { 621 615 if (port->status & ISI_DCD) { 622 616 if (!(header & ISI_DCD)) { 623 617 /* Carrier has been lost */ 624 - pr_dbg("interrupt: DCD->low.\n"); 618 + pr_dbg("interrupt: DCD->low.\n" 619 + ); 625 620 port->status &= ~ISI_DCD; 626 621 schedule_work(&port->hangup_tq); 627 622 } 623 + } else if (header & ISI_DCD) { 624 + /* Carrier has been detected */ 625 + pr_dbg("interrupt: DCD->high.\n"); 626 + port->status |= ISI_DCD; 627 + wake_up_interruptible(&port->open_wait); 628 628 } 629 - else { 630 - if (header & ISI_DCD) { 631 - /* Carrier has been detected */ 632 - pr_dbg("interrupt: DCD->high.\n"); 633 - port->status |= ISI_DCD; 634 - wake_up_interruptible(&port->open_wait); 635 - } 636 - } 637 - } 638 - else { 629 + } else { 639 630 if (header & ISI_DCD) 640 631 port->status |= ISI_DCD; 641 632 else ··· 643 642 if (header & ISI_CTS) { 644 643 port->tty->hw_stopped = 0; 645 644 /* start tx ing */ 646 - port->status |= (ISI_TXOK | ISI_CTS); 645 + port->status |= (ISI_TXOK 646 + | ISI_CTS); 647 647 schedule_work(&port->bh_tqueue); 648 648 } 649 + } else if (!(header & ISI_CTS)) { 650 + port->tty->hw_stopped = 1; 651 + /* stop tx ing */ 652 + port->status &= ~(ISI_TXOK | ISI_CTS); 649 653 } 650 - else { 651 - if (!(header & ISI_CTS)) { 652 - port->tty->hw_stopped = 1; 653 - /* stop tx ing */ 654 - port->status &= ~(ISI_TXOK | ISI_CTS); 655 - } 656 - } 657 - } 658 - else { 654 + } else { 659 655 if (header & ISI_CTS) 660 656 port->status |= ISI_CTS; 661 657 else ··· 671 673 672 674 break; 673 675 674 - case 1: /* Received Break !!! */ 676 + case 1: /* Received Break !!! */ 675 677 tty_insert_flip_char(tty, 0, TTY_BREAK); 676 678 if (port->flags & ASYNC_SAK) 677 679 do_SAK(tty); ··· 686 688 pr_dbg("Intr: Unknown code in status packet.\n"); 687 689 break; 688 690 } 689 - } 690 - else { /* Data Packet */ 691 + } else { /* Data Packet */ 691 692 692 693 count = tty_prepare_flip_string(tty, &rp, byte_count & ~1); 693 694 pr_dbg("Intr: Can rx %d of %d bytes.\n", count, byte_count); ··· 694 697 insw(base, rp, word_count); 695 698 byte_count -= (word_count << 1); 696 699 if (count & 0x0001) { 697 - tty_insert_flip_char(tty, inw(base) & 0xff, TTY_NORMAL); 700 + tty_insert_flip_char(tty, inw(base) & 0xff, 701 + TTY_NORMAL); 698 702 byte_count -= 2; 699 703 } 700 704 if (byte_count > 0) { ··· 712 714 ClearInterrupt(base); 713 715 else 714 716 outw(0x0000, base+0x04); /* enable interrupts */ 717 + 715 718 return IRQ_HANDLED; 716 719 } 717 720 ··· 884 885 return 0; 885 886 } 886 887 887 - static int block_til_ready(struct tty_struct *tty, struct file *filp, struct isi_port *port) 888 + static int block_til_ready(struct tty_struct *tty, struct file *filp, 889 + struct isi_port *port) 888 890 { 889 891 struct isi_board *card = port->card; 890 892 int do_clocal = 0, retval; ··· 905 905 906 906 /* if non-blocking mode is set ... */ 907 907 908 - if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { 908 + if ((filp->f_flags & O_NONBLOCK) || 909 + (tty->flags & (1 << TTY_IO_ERROR))) { 909 910 pr_dbg("block_til_ready: non-block mode.\n"); 910 911 port->flags |= ASYNC_NORMAL_ACTIVE; 911 912 return 0; ··· 1052 1051 card->count = 0; 1053 1052 } 1054 1053 1055 - /* last port was closed , shutdown that boad too */ 1054 + /* last port was closed, shutdown that boad too */ 1056 1055 if (C_HUPCL(tty)) { 1057 1056 if (!card->count) 1058 1057 isicom_shutdown_board(card); ··· 1079 1078 } 1080 1079 1081 1080 if (tty->count == 1 && port->count != 1) { 1082 - printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port count" 1083 - "tty->count = 1 port count = %d.\n", 1081 + printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port " 1082 + "count tty->count = 1 port count = %d.\n", 1084 1083 card->base, port->count); 1085 1084 port->count = 1; 1086 1085 } 1087 1086 if (--port->count < 0) { 1088 - printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port count for" 1089 - "channel%d = %d", card->base, port->channel, 1087 + printk(KERN_WARNING "ISICOM:(0x%lx) isicom_close: bad port " 1088 + "count for channel%d = %d", card->base, port->channel, 1090 1089 port->count); 1091 1090 port->count = 0; 1092 1091 } ··· 1122 1121 spin_unlock_irqrestore(&card->card_lock, flags); 1123 1122 if (port->close_delay) { 1124 1123 pr_dbg("scheduling until time out.\n"); 1125 - msleep_interruptible(jiffies_to_msecs(port->close_delay)); 1124 + msleep_interruptible( 1125 + jiffies_to_msecs(port->close_delay)); 1126 1126 } 1127 1127 spin_lock_irqsave(&card->card_lock, flags); 1128 1128 wake_up_interruptible(&port->open_wait); ··· 1151 1149 spin_lock_irqsave(&card->card_lock, flags); 1152 1150 1153 1151 while(1) { 1154 - cnt = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt - 1, 1155 - SERIAL_XMIT_SIZE - port->xmit_head)); 1152 + cnt = min_t(int, count, min(SERIAL_XMIT_SIZE - port->xmit_cnt 1153 + - 1, SERIAL_XMIT_SIZE - port->xmit_head)); 1156 1154 if (cnt <= 0) 1157 1155 break; 1158 1156 1159 1157 memcpy(port->xmit_buf + port->xmit_head, buf, cnt); 1160 - port->xmit_head = (port->xmit_head + cnt) & (SERIAL_XMIT_SIZE - 1); 1158 + port->xmit_head = (port->xmit_head + cnt) & (SERIAL_XMIT_SIZE 1159 + - 1); 1161 1160 port->xmit_cnt += cnt; 1162 1161 buf += cnt; 1163 1162 count -= cnt; ··· 1203 1200 if (isicom_paranoia_check(port, tty->name, "isicom_flush_chars")) 1204 1201 return; 1205 1202 1206 - if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || !port->xmit_buf) 1203 + if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || 1204 + !port->xmit_buf) 1207 1205 return; 1208 1206 1209 1207 /* this tells the transmitter to consider this port for ··· 1237 1233 } 1238 1234 1239 1235 /* ioctl et all */ 1240 - static inline void isicom_send_break(struct isi_port *port, unsigned long length) 1236 + static inline void isicom_send_break(struct isi_port *port, 1237 + unsigned long length) 1241 1238 { 1242 1239 struct isi_board *card = port->card; 1243 1240 unsigned long base = card->base; ··· 1373 1368 return 0; 1374 1369 1375 1370 case TIOCGSOFTCAR: 1376 - return put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)argp); 1371 + return put_user(C_CLOCAL(tty) ? 1 : 0, 1372 + (unsigned long __user *)argp); 1377 1373 1378 1374 case TIOCSSOFTCAR: 1379 1375 if (get_user(arg, (unsigned long __user *) argp))
+10 -11
include/linux/isicom.h
··· 9 9 #define YES 1 10 10 #define NO 0 11 11 12 - /* 12 + /* 13 13 * ISICOM Driver definitions ... 14 14 * 15 15 */ ··· 20 20 * PCI definitions 21 21 */ 22 22 23 - #define DEVID_COUNT 9 24 - #define VENDOR_ID 0x10b5 23 + #define DEVID_COUNT 9 24 + #define VENDOR_ID 0x10b5 25 25 26 26 /* 27 27 * These are now officially allocated numbers ··· 31 31 #define ISICOM_CMAJOR 113 /* callout */ 32 32 #define ISICOM_MAGIC (('M' << 8) | 'T') 33 33 34 - #define WAKEUP_CHARS 256 /* hard coded for now */ 35 - #define TX_SIZE 254 36 - 34 + #define WAKEUP_CHARS 256 /* hard coded for now */ 35 + #define TX_SIZE 254 36 + 37 37 #define BOARD_COUNT 4 38 38 #define PORT_COUNT (BOARD_COUNT*16) 39 39 ··· 66 66 #define BOARD(line) (((line) >> 4) & 0x3) 67 67 68 68 /* isi kill queue bitmap */ 69 - 69 + 70 70 #define ISICOM_KILLTX 0x01 71 71 #define ISICOM_KILLRX 0x02 72 72 73 73 /* isi_board status bitmap */ 74 - 74 + 75 75 #define FIRMWARE_LOADED 0x0001 76 76 #define BOARD_ACTIVE 0x0002 77 77 ··· 85 85 #define ISI_RTS 0x0200 86 86 87 87 88 - #define ISI_TXOK 0x0001 89 - 88 + #define ISI_TXOK 0x0001 89 + 90 90 #endif /* __KERNEL__ */ 91 91 92 92 #endif /* ISICOM_H */ 93 -