uart->out_buff cannot be NULL, remove this tests.
authorNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 15 Jun 2017 07:01:06 +0000 (09:01 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 15 Jun 2017 07:01:06 +0000 (09:01 +0200)
drivers/serial.c

index f5e561d..f74c789 100644 (file)
@@ -118,9 +118,8 @@ static void uart_check_tx(struct uart_device* uart, uint32_t intr)
 {
        /* We are currently sending, send next char */
        if (intr & LPC_UART_ST_TX_READY) {
 {
        /* We are currently sending, send next char */
        if (intr & LPC_UART_ST_TX_READY) {
-               if (uart->out_buff && uart->sending && (uart->out_length > uart->sending)) {
-                       uart->regs->tx_data = uart->out_buff[uart->sending];
-                       uart->sending++;
+               if (uart->sending && (uart->out_length > uart->sending)) {
+                       uart->regs->tx_data = uart->out_buff[uart->sending++];
                } else {
                        uart->sending = 0;
                        uart->regs->inten_clear = LPC_UART_ST_TX_READY;
                } else {
                        uart->sending = 0;
                        uart->regs->inten_clear = LPC_UART_ST_TX_READY;