Message ID | 20221118122539.384993-10-brgl@bgdev.pl (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | serial: qcom-geni-serial: implement support for SE DMA | expand |
On 18/11/2022 13:25, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > > The return value of the handle_rx() callback is never checked. Drop it. > > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad > drivers/tty/serial/qcom_geni_serial.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c > index 4b155ca0ac74..72d0e7b91080 100644 > --- a/drivers/tty/serial/qcom_geni_serial.c > +++ b/drivers/tty/serial/qcom_geni_serial.c > @@ -114,7 +114,7 @@ struct qcom_geni_serial_port { > u32 tx_fifo_width; > u32 rx_fifo_depth; > bool setup; > - int (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); > + void (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); > unsigned int baud; > void *rx_fifo; > u32 loopback; > @@ -499,7 +499,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, > spin_unlock_irqrestore(&uport->lock, flags); > } > > -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) > +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) > { > u32 i; > unsigned char buf[sizeof(u32)]; > @@ -534,16 +534,15 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) > } > if (!drop) > tty_flip_buffer_push(tport); > - return 0; > } > #else > -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) > +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) > { > - return -EPERM; > + > } > #endif /* CONFIG_SERIAL_QCOM_GENI_CONSOLE */ > > -static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) > +static void handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) > { > struct tty_port *tport; > struct qcom_geni_serial_port *port = to_dev_port(uport); > @@ -554,7 +553,7 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) > tport = &uport->state->port; > ioread32_rep(uport->membase + SE_GENI_RX_FIFOn, port->rx_fifo, words); > if (drop) > - return 0; > + return; > > ret = tty_insert_flip_string(tport, port->rx_fifo, bytes); > if (ret != bytes) { > @@ -564,7 +563,6 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) > } > uport->icount.rx += ret; > tty_flip_buffer_push(tport); > - return ret; > } > > static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index 4b155ca0ac74..72d0e7b91080 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -114,7 +114,7 @@ struct qcom_geni_serial_port { u32 tx_fifo_width; u32 rx_fifo_depth; bool setup; - int (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); + void (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); unsigned int baud; void *rx_fifo; u32 loopback; @@ -499,7 +499,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, spin_unlock_irqrestore(&uport->lock, flags); } -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) { u32 i; unsigned char buf[sizeof(u32)]; @@ -534,16 +534,15 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) } if (!drop) tty_flip_buffer_push(tport); - return 0; } #else -static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) { - return -EPERM; + } #endif /* CONFIG_SERIAL_QCOM_GENI_CONSOLE */ -static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) +static void handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) { struct tty_port *tport; struct qcom_geni_serial_port *port = to_dev_port(uport); @@ -554,7 +553,7 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) tport = &uport->state->port; ioread32_rep(uport->membase + SE_GENI_RX_FIFOn, port->rx_fifo, words); if (drop) - return 0; + return; ret = tty_insert_flip_string(tport, port->rx_fifo, bytes); if (ret != bytes) { @@ -564,7 +563,6 @@ static int handle_rx_uart(struct uart_port *uport, u32 bytes, bool drop) } uport->icount.rx += ret; tty_flip_buffer_push(tport); - return ret; } static unsigned int qcom_geni_serial_tx_empty(struct uart_port *uport)