Re: [Xen-devel] [PATCH 2/3] Remove useless ASSERT condition

2020-01-18 Thread Julien Grall



On 09/10/2019 15:56, Julien Grall wrote:

Hi Artem,


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 


Acked-by: Julien Grall 


I was going through my todo list and noticed I have never committed this 
patch. Apologies for that.


I have committed it with a slight change in the commit title:

"xen/char: scif-uart: Remove useless ASSERT condition"

In the future, please try to add the component in the title :).

Cheers,




---
  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,



--
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH 2/3] Remove useless ASSERT condition

2019-10-09 Thread Julien Grall

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 


Acked-by: Julien Grall 


---
  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,

--
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

[Xen-devel] [PATCH 2/3] Remove useless ASSERT condition

2019-10-09 Thread Artem Mygaiev
cnt is unsigned, so always >=0

Coverity-ID: 1381848
Signed-off-by: Artem Mygaiev 
---
 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);
 }
-- 
2.20.1


___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel