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

serial: clean up parameter passing for 8250 Rx IRQ handling

The receive_chars() was taking a pointer to a passed in LSR value
in status and knocking off bits as it processed them. But since
receive_chars isn't returning a value, we can instead pass in
a normal non-pointer value for LSR, and simply return the
residual (unprocessed) LSR once it is done.

The value in this cleanup, is that it clarifies the API of the
receive_chars prior to exporting it to other 8250-like drivers
for shared usage.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Paul Gortmaker and committed by
Greg Kroah-Hartman
0690f41f 850624c1

+11 -6
+11 -6
drivers/tty/serial/8250.c
··· 1375 1375 } while (1); 1376 1376 } 1377 1377 1378 - static void 1379 - receive_chars(struct uart_8250_port *up, unsigned int *status) 1378 + /* 1379 + * receive_chars: processes according to the passed in LSR 1380 + * value, and returns the remaining LSR bits not handled 1381 + * by this Rx routine. 1382 + */ 1383 + static unsigned char 1384 + receive_chars(struct uart_8250_port *up, unsigned char lsr) 1380 1385 { 1381 1386 struct tty_struct *tty = up->port.state->port.tty; 1382 - unsigned char ch, lsr = *status; 1387 + unsigned char ch; 1383 1388 int max_count = 256; 1384 1389 char flag; 1385 1390 ··· 1460 1455 spin_unlock(&up->port.lock); 1461 1456 tty_flip_buffer_push(tty); 1462 1457 spin_lock(&up->port.lock); 1463 - *status = lsr; 1458 + return lsr; 1464 1459 } 1465 1460 1466 1461 static void transmit_chars(struct uart_8250_port *up) ··· 1529 1524 */ 1530 1525 static void serial8250_handle_port(struct uart_8250_port *up) 1531 1526 { 1532 - unsigned int status; 1527 + unsigned char status; 1533 1528 unsigned long flags; 1534 1529 1535 1530 spin_lock_irqsave(&up->port.lock, flags); ··· 1539 1534 DEBUG_INTR("status = %x...", status); 1540 1535 1541 1536 if (status & (UART_LSR_DR | UART_LSR_BI)) 1542 - receive_chars(up, &status); 1537 + status = receive_chars(up, status); 1543 1538 check_modem_status(up); 1544 1539 if (status & UART_LSR_THRE) 1545 1540 transmit_chars(up);