mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
staging: dgnc: clean up dgnc_input function
This is for fixing checkpatch.pl warning about "Alignment should match open parenthesis" but if that is fixed, code line is over 80 characters. I think "ch->ch_rqueue + tail + i" could be declared once in the begining of loop. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e491e716dc
commit
56d118c243
1 changed files with 14 additions and 21 deletions
|
@ -602,6 +602,8 @@ void dgnc_input(struct channel_t *ch)
|
||||||
* or the amount of data the card actually has pending...
|
* or the amount of data the card actually has pending...
|
||||||
*/
|
*/
|
||||||
while (n) {
|
while (n) {
|
||||||
|
unsigned char *ch_pos = ch->ch_equeue + tail;
|
||||||
|
|
||||||
s = ((head >= tail) ? head : RQUEUESIZE) - tail;
|
s = ((head >= tail) ? head : RQUEUESIZE) - tail;
|
||||||
s = min(s, n);
|
s = min(s, n);
|
||||||
|
|
||||||
|
@ -616,29 +618,20 @@ void dgnc_input(struct channel_t *ch)
|
||||||
*/
|
*/
|
||||||
if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
|
if (I_PARMRK(tp) || I_BRKINT(tp) || I_INPCK(tp)) {
|
||||||
for (i = 0; i < s; i++) {
|
for (i = 0; i < s; i++) {
|
||||||
if (*(ch->ch_equeue + tail + i) & UART_LSR_BI)
|
unsigned char ch = *(ch_pos + i);
|
||||||
tty_insert_flip_char(tp->port,
|
char flag = TTY_NORMAL;
|
||||||
*(ch->ch_rqueue + tail + i),
|
|
||||||
TTY_BREAK);
|
if (ch & UART_LSR_BI)
|
||||||
else if (*(ch->ch_equeue + tail + i) &
|
flag = TTY_BREAK;
|
||||||
UART_LSR_PE)
|
else if (ch & UART_LSR_PE)
|
||||||
tty_insert_flip_char(tp->port,
|
flag = TTY_PARITY;
|
||||||
*(ch->ch_rqueue + tail + i),
|
else if (ch & UART_LSR_FE)
|
||||||
TTY_PARITY);
|
flag = TTY_FRAME;
|
||||||
else if (*(ch->ch_equeue + tail + i) &
|
|
||||||
UART_LSR_FE)
|
tty_insert_flip_char(tp->port, ch, flag);
|
||||||
tty_insert_flip_char(tp->port,
|
|
||||||
*(ch->ch_rqueue + tail + i),
|
|
||||||
TTY_FRAME);
|
|
||||||
else
|
|
||||||
tty_insert_flip_char(tp->port,
|
|
||||||
*(ch->ch_rqueue + tail + i),
|
|
||||||
TTY_NORMAL);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tty_insert_flip_string(tp->port,
|
tty_insert_flip_string(tp->port, ch_pos, s);
|
||||||
ch->ch_rqueue + tail,
|
|
||||||
s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tail += s;
|
tail += s;
|
||||||
|
|
Loading…
Add table
Reference in a new issue