Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b33f918 authored by Fernando Apesteguia's avatar Fernando Apesteguia Committed by Greg Kroah-Hartman
Browse files

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: default avatarFernando Apesteguia <fernando.apesteguia@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1100a3b0
Loading
Loading
Loading
Loading
+39 −25
Original line number Diff line number Diff line
@@ -102,6 +102,8 @@ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf,
static void dgnc_tty_set_termios(struct tty_struct *tty,
				 struct ktermios *old_termios);
static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch);
static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char line);
static void dgnc_wake_up_unit(struct un_t *unit);

static const struct tty_operations dgnc_tty_ops = {
	.open = dgnc_tty_open,
@@ -784,6 +786,12 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
	}
}

static void dgnc_set_signal_low(struct channel_t *ch, const unsigned char sig)
{
	ch->ch_mostat &= ~(sig);
	ch->ch_bd->bd_ops->assert_modem_signals(ch);
}

void dgnc_wakeup_writes(struct channel_t *ch)
{
	int qlen = 0;
@@ -821,19 +829,15 @@ void dgnc_wakeup_writes(struct channel_t *ch)
				 * If RTS Toggle mode is on, whenever
				 * the queue and UART is empty, keep RTS low.
				 */
				if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE) {
					ch->ch_mostat &= ~(UART_MCR_RTS);
					ch->ch_bd->bd_ops->assert_modem_signals(ch);
				}
				if (ch->ch_digi.digi_flags & DIGI_RTS_TOGGLE)
					dgnc_set_signal_low(ch, UART_MCR_RTS);

				/*
				 * If DTR Toggle mode is on, whenever
				 * the queue and UART is empty, keep DTR low.
				 */
				if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE) {
					ch->ch_mostat &= ~(UART_MCR_DTR);
					ch->ch_bd->bd_ops->assert_modem_signals(ch);
				}
				if (ch->ch_digi.digi_flags & DIGI_DTR_TOGGLE)
					dgnc_set_signal_low(ch, UART_MCR_DTR);
			}
		}

@@ -967,7 +971,8 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
	 * touched safely, the close routine will signal the
	 * ch_flags_wait to wake us back up.
	 */
	rc = wait_event_interruptible(ch->ch_flags_wait, (((ch->ch_tun.un_flags |
	rc = wait_event_interruptible(ch->ch_flags_wait,
			(((ch->ch_tun.un_flags |
			   ch->ch_pun.un_flags) & UN_CLOSING) == 0));

	/* If ret is non-zero, user ctrl-c'ed us */
@@ -1184,7 +1189,8 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
		 */
		if (sleep_on_un_flags)
			retval = wait_event_interruptible
				(un->un_flags_wait, (old_flags != (ch->ch_tun.un_flags |
				(un->un_flags_wait,
				 (old_flags != (ch->ch_tun.un_flags |
						ch->ch_pun.un_flags)));
		else
			retval = wait_event_interruptible(ch->ch_flags_wait,
@@ -2320,6 +2326,17 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
	spin_unlock_irqrestore(&ch->ch_lock, flags);
}

/*
 * dgnc_wake_up_unit()
 *
 * Wakes up processes waiting in the unit's (teminal/printer) wait queue
 */
static void dgnc_wake_up_unit(struct un_t *unit)
{
	unit->un_flags &= ~(UN_LOW | UN_EMPTY);
	wake_up_interruptible(&unit->un_flags_wait);
}

/* The IOCTL function and all of its helpers */

/*
@@ -2502,17 +2519,11 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
				ch->ch_w_head = ch->ch_w_tail;
				ch_bd_ops->flush_uart_write(ch);

				if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY)) {
					ch->ch_tun.un_flags &=
						~(UN_LOW | UN_EMPTY);
					wake_up_interruptible(&ch->ch_tun.un_flags_wait);
				}
				if (ch->ch_tun.un_flags & (UN_LOW | UN_EMPTY))
					dgnc_wake_up_unit(&ch->ch_tun);

				if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY)) {
					ch->ch_pun.un_flags &=
						~(UN_LOW | UN_EMPTY);
					wake_up_interruptible(&ch->ch_pun.un_flags_wait);
				}
				if (ch->ch_pun.un_flags & (UN_LOW | UN_EMPTY))
					dgnc_wake_up_unit(&ch->ch_pun);
			}
		}

@@ -2731,7 +2742,10 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
		buf.rxbuf = (ch->ch_r_head - ch->ch_r_tail) & RQUEUEMASK;
		buf.txbuf = (ch->ch_w_head - ch->ch_w_tail) & WQUEUEMASK;

		/* Is the UART empty? Add that value to whats in our TX queue. */
		/*
		 * Is the UART empty?
		 * Add that value to whats in our TX queue.
		 */

		count = buf.txbuf + ch_bd_ops->get_uart_bytes_left(ch);