Skip to contentSkip to conversation

minor lgtm warning fixes

PATCH In review Stephen Hemminger 4 participants 7 messages Mar 27, 2019 – Mar 28, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

cover minor lgtm warning fixes

Looks like the LGTM checker complains about condition checks that are always true.

Stephen Hemminger (2):
net/netvsc: fix lgtm static checker complaint
net/virtio: fix lgtm static checker complaint

 drivers/net/netvsc/hn_rxtx.c     | 2 +-
 drivers/net/virtio/virtio_rxtx.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 net/netvsc: fix lgtm static checker complaint

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.

---
 drivers/net/netvsc/hn_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/netvsc/hn_rxtx.c +1 -1
index 6197118b01ee..8818d68cea5c 100644
@@ -123,7 +123,7 @@ hn_update_packet_stats(struct hn_stats *stats, const struct rte_mbuf *m)
 			stats->size_bins[0]++;
 		else if (s < 1519)
 			stats->size_bins[6]++;
-		else if (s >= 1519)
+		else
 			stats->size_bins[7]++;
 	}
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 2/2 net/virtio: fix lgtm static checker complaint

In reply to Stephen Hemminger

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.

---
 drivers/net/virtio/virtio_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_rxtx.c +1 -1
index 5f6796bdba37..268fe3b8f156 100644
@@ -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]++;
 	}
 
Signature · 1 line
2.17.1
Reviewed-by on v1 2/2
#5 lore raw

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

In reply to Stephen Hemminger
Quoted 15 lines · Stephen Hemminger

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.

---
  drivers/net/virtio/virtio_rxtx.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_rxtx.c +0 -0
index 5f6796bdba37..268fe3b8f156 100644

drivers/net/virtio/virtio_rxtx.c virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) · line 1116

Quoted 8 lines
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -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]++;
  	}
 
#6 lore raw
In reply to Stephen Hemminger
Quoted 6 lines · Stephen Hemminger

Looks like the LGTM checker complains about condition checks that are always true.

Stephen Hemminger (2):
net/netvsc: fix lgtm static checker complaint
net/virtio: fix lgtm static checker complaint

Series applied to dpdk-next-net/master, thanks.