From 12cfa6444cd239dbc04391027ad3161f53b6901c Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 20 Oct 2021 00:05:11 +0200 Subject: passt: Add clang-tidy Makefile target and test, take care of warnings Most are just about style and form, but a few were actually serious mistakes (NDP-related). Signed-off-by: Stefano Brivio --- icmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'icmp.c') diff --git a/icmp.c b/icmp.c index 51848c2..7d7b688 100644 --- a/icmp.c +++ b/icmp.c @@ -254,11 +254,11 @@ void icmp_timer(struct ctx *c, struct timespec *ts) v6: word = (long *)icmp_act[v6 ? V6 : V4]; - for (i = 0; i < sizeof(icmp_act[0]) / sizeof(long); i++, word++) { + for (i = 0; i < ARRAY_SIZE(icmp_act); i += sizeof(long), word++) { tmp = *word; while ((n = ffsl(tmp))) { tmp &= ~(1UL << (n - 1)); - icmp_timer_one(c, v6, i * sizeof(long) * 8 + n - 1, ts); + icmp_timer_one(c, v6, i * 8 + n - 1, ts); } } -- cgit v1.2.3