]> git.baikalelectronics.ru Git - kernel.git/commit
serial: stm32: Fix comparisons with undefined register
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 6 Oct 2016 13:42:54 +0000 (15:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Oct 2016 14:00:31 +0000 (16:00 +0200)
commit3e106d3242b2b615bfad0b0fce66e9b91410e97c
tree8268ae3e1fcd291c1cb2ae0a8a4e374ad54b013c
parente5a3ad0cc6bc4fda6e241689b153ad9f21ffea74
serial: stm32: Fix comparisons with undefined register

    drivers/tty/serial/stm32-usart.c: In function ‘stm32_receive_chars’:
    drivers/tty/serial/stm32-usart.c:130: warning: comparison is always true due to limited range of data type
    drivers/tty/serial/stm32-usart.c: In function ‘stm32_tx_dma_complete’:
    drivers/tty/serial/stm32-usart.c:177: warning: comparison is always false due to limited range of data type

stm32_usart_offsets.icr is u8, while UNDEF_REG = ~0 is int, and thus
0xffffffff.

As all registers in stm32_usart_offsets are u8, change the definition of
UNDEF_REG to 0xff to fix this.

Fixes: 882d302303ab5d89 ("serial: stm32: adding support for stm32f7")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.h