[2/3] Remove useless ASSERT condition
diff mbox series

Message ID bfa088ac3fc17b90c2ba953e56294e9b26e8f5cc.1570628924.git.artem_mygaiev@epam.com
State New
Headers show
Series
  • Minor Coverity fixes
Related show

Commit Message

Artem Mygaiev Oct. 9, 2019, 2:20 p.m. UTC
cnt is unsigned, so always >=0

Coverity-ID: 1381848
Signed-off-by: Artem Mygaiev <artem_mygaiev@epam.com>
---
 xen/drivers/char/scif-uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Julien Grall Oct. 9, 2019, 2:56 p.m. UTC | #1
Hi Artem,

On 09/10/2019 15:20, Artem Mygaiev wrote:
> cnt is unsigned, so always >=0
> 
> Coverity-ID: 1381848
> Signed-off-by: Artem Mygaiev <artem_mygaiev@epam.com>

Acked-by: Julien Grall <julien.grall@arm.com>

> ---
>   xen/drivers/char/scif-uart.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
> index fa0b8274ca..9d3f66b55b 100644
> --- a/xen/drivers/char/scif-uart.c
> +++ b/xen/drivers/char/scif-uart.c
> @@ -205,7 +205,7 @@ static int scif_uart_tx_ready(struct serial_port *port)
>   
>        /* Check number of data bytes stored in TX FIFO */
>       cnt = scif_readw(uart, SCIF_SCFDR) >> 8;
> -    ASSERT( cnt >= 0 && cnt <= params->fifo_size );
> +    ASSERT( cnt <= params->fifo_size );
>   
>       return (params->fifo_size - cnt);
>   }
> 

Cheers,

Patch
diff mbox series

diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
index fa0b8274ca..9d3f66b55b 100644
--- a/xen/drivers/char/scif-uart.c
+++ b/xen/drivers/char/scif-uart.c
@@ -205,7 +205,7 @@  static int scif_uart_tx_ready(struct serial_port *port)
 
      /* Check number of data bytes stored in TX FIFO */
     cnt = scif_readw(uart, SCIF_SCFDR) >> 8;
-    ASSERT( cnt >= 0 && cnt <= params->fifo_size );
+    ASSERT( cnt <= params->fifo_size );
 
     return (params->fifo_size - cnt);
 }