[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230628233813.6564-6-stephen@networkplumber.org>
Date: Wed, 28 Jun 2023 16:38:13 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 5/5] ifstat: fix warning about conditional
Gcc with warnings enabled complains because the conditional.
if ((long)(a - b) < 0)
could be construed as never true. Change to simple comparison.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
misc/ifstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ifstat.c b/misc/ifstat.c
index 4ce5ca8af4e7..f6f9ba5027d3 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -608,7 +608,7 @@ static void update_db(int interval)
int i;
for (i = 0; i < MAXS; i++) {
- if ((long)(h1->ival[i] - n->ival[i]) < 0) {
+ if (h1->ival[i] < n->ival[i]) {
memset(n->ival, 0, sizeof(n->ival));
break;
}
--
2.39.2
Powered by blists - more mailing lists