[2/2] net/virtio: fix lgtm static checker complaint

Message ID 20190327210843.13813-3-stephen@networkplumber.org (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series minor lgtm warning fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Stephen Hemminger March 27, 2019, 9:08 p.m. UTC
  Since previous test is for mtu < 1519 the next else if
is always true. This causes the lgtm static tool to complain.
Not a real issue, just cosmetic.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/virtio/virtio_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Rami Rosen March 28, 2019, 12:28 a.m. UTC | #1
Acked-by: Rami Rosen <ramirose@gmail.com>
  
Maxime Coquelin March 28, 2019, 11:04 a.m. UTC | #2
On 3/27/19 10:08 PM, Stephen Hemminger wrote:
> Since previous test is for mtu < 1519 the next else if
> is always true. This causes the lgtm static tool to complain.
> Not a real issue, just cosmetic.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   drivers/net/virtio/virtio_rxtx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
> index 5f6796bdba37..268fe3b8f156 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -1110,7 +1110,7 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
>   			stats->size_bins[0]++;
>   		else if (s < 1519)
>   			stats->size_bins[6]++;
> -		else if (s >= 1519)
> +		else
>   			stats->size_bins[7]++;
>   	}
>   
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  

Patch

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 5f6796bdba37..268fe3b8f156 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1110,7 +1110,7 @@  virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
 			stats->size_bins[0]++;
 		else if (s < 1519)
 			stats->size_bins[6]++;
-		else if (s >= 1519)
+		else
 			stats->size_bins[7]++;
 	}