serial: imx: remove a redundant check
authorTom Rix <trix@redhat.com>
Sat, 11 Feb 2023 15:45:50 +0000 (07:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Feb 2023 12:50:31 +0000 (13:50 +0100)
commit3f92730eed57f8057e1e120a0a2e8ad04ba155d4
treeb08f5e9b5910401021d2dd22d3844a0307fd90aa
parent370f696e44745b321054496fa351dade03fc4bd9
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 <trix@redhat.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://lore.kernel.org/r/20230211154550.2130670-1-trix@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c