Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: dgnc: Fix lines longer than 80 characters

For two cases (beginning and end of the patch) I opted to create small
functions instead of breaking the the lines in a weird way.

The other changes are simple ones: either by breaking the line when
appropriate or by turning a comment into a multi-line one.

Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Fernando Apesteguia and committed by
Greg Kroah-Hartman
9b33f918 1100a3b0

+38 -24
+38 -24
drivers/staging/dgnc/dgnc_tty.c
··· 102 102 static void dgnc_tty_set_termios(struct tty_struct *tty, 103 103 struct ktermios *old_termios); 104 104 static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch); 105 + static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char line); 106 + static void dgnc_wake_up_unit(struct un_t *unit); 105 107 106 108 static const struct tty_operations dgnc_tty_ops = { 107 109 .open = dgnc_tty_open, ··· 786 784 } 787 785 } 788 786 787 + static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char sig) 788 + { 789 + ch->ch_mostat &= ~(sig); 790 + ch->ch_bd->bd_ops->assert_modem_signals(ch); 791 + } 792 + 789 793 void dgnc_wakeup_writes(struct channel_t *ch) 790 794 { 791 795 int qlen = 0; ··· 829 821 * If RTS Toggle mode is on, whenever 830 822 * the queue and UART is empty, keep RTS low. 831 823 */ 832 - if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) { 833 - ch->ch_mostat &= ~(UART_MCR_RTS); 834 - ch->ch_bd->bd_ops->assert_modem_signals(ch); 835 - } 824 + if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) 825 + dgnc_set_signal_low(ch, UART_MCR_RTS); 836 826 837 827 /* 838 828 * If DTR Toggle mode is on, whenever 839 829 * the queue and UART is empty, keep DTR low. 840 830 */ 841 - if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) { 842 - ch->ch_mostat &= ~(UART_MCR_DTR); 843 - ch->ch_bd->bd_ops->assert_modem_signals(ch); 844 - } 831 + if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) 832 + dgnc_set_signal_low(ch, UART_MCR_DTR); 845 833 } 846 834 } 847 835 ··· 971 967 * touched safely, the close routine will signal the 972 968 * ch_flags_wait to wake us back up. 973 969 */ 974 - rc = wait_event_interruptible(ch->ch_flags_wait, (((ch->ch_tun.un_flags | 975 - ch->ch_pun.un_flags) & UN_CLOSING) == 0)); 970 + rc = wait_event_interruptible(ch->ch_flags_wait, 971 + (((ch->ch_tun.un_flags | 972 + ch->ch_pun.un_flags) & UN_CLOSING) == 0)); 976 973 977 974 /* If ret is non-zero, user ctrl-c'ed us */ 978 975 if (rc) ··· 1189 1184 */ 1190 1185 if (sleep_on_un_flags) 1191 1186 retval = wait_event_interruptible 1192 - (un->un_flags_wait, (old_flags != (ch->ch_tun.un_flags | 1193 - ch->ch_pun.un_flags))); 1187 + (un->un_flags_wait, 1188 + (old_flags != (ch->ch_tun.un_flags | 1189 + ch->ch_pun.un_flags))); 1194 1190 else 1195 1191 retval = wait_event_interruptible(ch->ch_flags_wait, 1196 - (old_flags != ch->ch_flags)); 1192 + (old_flags != ch->ch_flags)); 1197 1193 1198 1194 /* 1199 1195 * We got woken up for some reason. ··· 2326 2320 spin_unlock_irqrestore(&ch->ch_lock, flags); 2327 2321 } 2328 2322 2323 + /* 2324 + * dgnc_wake_up_unit() 2325 + * 2326 + * Wakes up processes waiting in the unit's (teminal/printer) wait queue 2327 + */ 2328 + static void dgnc_wake_up_unit(struct un_t *unit) 2329 + { 2330 + unit->un_flags &= ~(UN_LOW | UN_EMPTY); 2331 + wake_up_interruptible(&unit->un_flags_wait); 2332 + } 2333 + 2329 2334 /* The IOCTL function and all of its helpers */ 2330 2335 2331 2336 /* ··· 2519 2502 ch->ch_w_head = ch->ch_w_tail; 2520 2503 ch_bd_ops->flush_uart_write(ch); 2521 2504 2522 - if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY)) { 2523 - ch->ch_tun.un_flags &= 2524 - ~(UN_LOW | UN_EMPTY); 2525 - wake_up_interruptible(&ch->ch_tun.un_flags_wait); 2526 - } 2505 + if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY)) 2506 + dgnc_wake_up_unit(&ch->ch_tun); 2527 2507 2528 - if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY)) { 2529 - ch->ch_pun.un_flags &= 2530 - ~(UN_LOW | UN_EMPTY); 2531 - wake_up_interruptible(&ch->ch_pun.un_flags_wait); 2532 - } 2508 + if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY)) 2509 + dgnc_wake_up_unit(&ch->ch_pun); 2533 2510 } 2534 2511 } 2535 2512 ··· 2742 2731 buf.rxbuf = (ch->ch_r_head - ch->ch_r_tail) & RQUEUEMASK; 2743 2732 buf.txbuf = (ch->ch_w_head - ch->ch_w_tail) & WQUEUEMASK; 2744 2733 2745 - /* Is the UART empty? Add that value to whats in our TX queue. */ 2734 + /* 2735 + * Is the UART empty? 2736 + * Add that value to whats in our TX queue. 2737 + */ 2746 2738 2747 2739 count = buf.txbuf + ch_bd_ops->get_uart_bytes_left(ch); 2748 2740