minor lgtm warning fixes
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
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
@@ -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
Re: [PATCH 1/2] net/netvsc: fix lgtm static checker complaint
PATCH 2/2 net/virtio: fix lgtm static checker complaint
In reply to Stephen HemmingerSince 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
@@ -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
Re: [PATCH 2/2] net/virtio: fix lgtm static checker complaint
Re: [PATCH 2/2] net/virtio: fix lgtm static checker complaint
In reply to Stephen HemmingerQuoted 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.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/virtio/virtio_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/virtio/virtio_rxtx.c +0
-0
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]++; }
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.