Skip to content

Commit 3f92730

Browse files
Tom Rixgregkh
authored andcommitted
serial: imx: remove a redundant check
cpp_check reports drivers/tty/serial/imx.c:1207:15: style: Condition 'r_bytes>0' is always true [knownConditionTrueFalse] if (r_bytes > 0) { r_byte is set to r_bytes = rx_ring->head - rx_ring->tail; The head - tail calculation is also done by the earlier check if (rx_ring->head <= sg_dma_len(sgl) && rx_ring->head > rx_ring->tail) { so r_bytes will always be > 0, so the second check is not needed. Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Iuliana Prodan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 370f696 commit 3f92730

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/tty/serial/imx.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,11 +1204,9 @@ static void imx_uart_dma_rx_callback(void *data)
12041204
r_bytes = rx_ring->head - rx_ring->tail;
12051205

12061206
/* If we received something, check for 0xff flood */
1207-
if (r_bytes > 0) {
1208-
spin_lock(&sport->port.lock);
1209-
imx_uart_check_flood(sport, imx_uart_readl(sport, USR2));
1210-
spin_unlock(&sport->port.lock);
1211-
}
1207+
spin_lock(&sport->port.lock);
1208+
imx_uart_check_flood(sport, imx_uart_readl(sport, USR2));
1209+
spin_unlock(&sport->port.lock);
12121210

12131211
if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) {
12141212

0 commit comments

Comments
 (0)