Skip to contentSkip to conversation

serial: 8250: Extract IIR logic steering from rx dma

bug report Dan Carpenter 1 participant 1 message May 3, 2021 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

Hello Peter Hurley,

The patch 33d9b8b23a73: "serial: 8250: Extract IIR logic steering from rx dma" from Apr 9, 2016, leads to the following static checker warning:

	drivers/tty/serial/8250/8250_omap.c:1093 handle_rx_dma()
	warn: signedness bug returning '(-22)'

drivers/tty/serial/8250/8250_omap.c
1084 static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)

               ^^^^

This returns bool

1085 {

  1086          switch (iir & 0x3f) {
  1087          case UART_IIR_RLSI:
  1088          case UART_IIR_RX_TIMEOUT:
  1089          case UART_IIR_RDI:
  1090                  omap_8250_rx_dma_flush(up);
  1091                  return true;
  1092          }
  1093          return omap_8250_rx_dma(up);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This returns error codes

1094 }
1095
1096 static unsigned char omap_8250_handle_rx_dma(struct uart_8250_port *up,
1097 u8 iir, unsigned char status)
1098 {
1099 if ((status & (UART_LSR_DR | UART_LSR_BI)) &&
1100 (iir & UART_IIR_RDI)) {

  1101                  if (handle_rx_dma(up, iir)) {
                            ^^^^^^^^^^^^^^^^^^^^^^

So I guess this is reversed for the omap_8250_rx_dma() case.

  1102                          status = serial8250_rx_chars(up, status);
  1103                          omap_8250_rx_dma(up);
  1104                  }
  1105          }
  1106  
  1107          return status;
  1108  }

regards,
dan carpenter