From eae4304000cb72cbb2e422474705ab9b2e38c939 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 8 Dec 2023 01:31:36 +1100 Subject: util: Use htonl_constant() in more places We might as well when we're passing a known constant value, giving the compiler the best chance to optimise things away. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index fb8c3f1..d2320f8 100644 --- a/util.h +++ b/util.h @@ -111,9 +111,9 @@ #endif #define IN4_IS_ADDR_UNSPECIFIED(a) \ - ((a)->s_addr == htonl(INADDR_ANY)) + ((a)->s_addr == htonl_constant(INADDR_ANY)) #define IN4_IS_ADDR_BROADCAST(a) \ - ((a)->s_addr == htonl(INADDR_BROADCAST)) + ((a)->s_addr == htonl_constant(INADDR_BROADCAST)) #define IN4_IS_ADDR_LOOPBACK(a) \ (ntohl((a)->s_addr) >> IN_CLASSA_NSHIFT == IN_LOOPBACKNET) #define IN4_IS_ADDR_MULTICAST(a) \ -- cgit v1.2.3