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 <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
4871b51b92
commit
e88718fc0b
@ -57,9 +57,9 @@ static inline bool in6_equal_mach(const struct in6_addr *a,
|
|||||||
const struct in6_addr *b,
|
const struct in6_addr *b,
|
||||||
int prefix_len)
|
int prefix_len)
|
||||||
{
|
{
|
||||||
if (memcmp(&(a->s6_addr[(prefix_len + 7) / 8]),
|
if (memcmp(&(a->s6_addr[DIV_ROUND_UP(prefix_len, 8)]),
|
||||||
&(b->s6_addr[(prefix_len + 7) / 8]),
|
&(b->s6_addr[DIV_ROUND_UP(prefix_len, 8)]),
|
||||||
16 - (prefix_len + 7) / 8) != 0) {
|
16 - DIV_ROUND_UP(prefix_len, 8)) != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user