From: Marc-André Lureau Date: Thu, 22 Jun 2017 12:41:45 +0000 (+0200) Subject: slirp: use DIV_ROUND_UP X-Git-Tag: v2.10.0-rc0~60^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e88718fc0b0399147327adfb369793407482a895;p=thirdparty%2Fqemu.git slirp: use DIV_ROUND_UP I used the clang-tidy qemu-round check to generate the fix: https://github.com/elmarco/clang-tools-extra Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- diff --git a/slirp/ip6.h b/slirp/ip6.h index 0908855f0f1..b1bea43b3c9 100644 --- a/slirp/ip6.h +++ b/slirp/ip6.h @@ -57,9 +57,9 @@ static inline bool in6_equal_mach(const struct in6_addr *a, const struct in6_addr *b, int prefix_len) { - if (memcmp(&(a->s6_addr[(prefix_len + 7) / 8]), - &(b->s6_addr[(prefix_len + 7) / 8]), - 16 - (prefix_len + 7) / 8) != 0) { + if (memcmp(&(a->s6_addr[DIV_ROUND_UP(prefix_len, 8)]), + &(b->s6_addr[DIV_ROUND_UP(prefix_len, 8)]), + 16 - DIV_ROUND_UP(prefix_len, 8)) != 0) { return 0; }