From: Kuniyuki Iwashima Date: Fri, 9 Aug 2024 23:54:06 +0000 (-0700) Subject: ip: Move INFINITY_LIFE_TIME to addrconf.h. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=de67763cbdbba8149eeb5d45ad0c6834f7c7b352;p=linux.git ip: Move INFINITY_LIFE_TIME to addrconf.h. INFINITY_LIFE_TIME is the common value used in IPv4 and IPv6 but defined in both .c files. Also, 0xffffffff used in addrconf_timeout_fixup() is INFINITY_LIFE_TIME. Let's move INFINITY_LIFE_TIME's definition to addrconf.h Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20240809235406.50187-6-kuniyu@amazon.com Signed-off-by: Jakub Kicinski --- diff --git a/include/net/addrconf.h b/include/net/addrconf.h index b18e81f0c9e1..c8ed31828db3 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h @@ -187,10 +187,12 @@ static inline int addrconf_ifid_eui48(u8 *eui, struct net_device *dev) return 0; } +#define INFINITY_LIFE_TIME 0xFFFFFFFF + static inline unsigned long addrconf_timeout_fixup(u32 timeout, unsigned int unit) { - if (timeout == 0xffffffff) + if (timeout == INFINITY_LIFE_TIME) return ~0UL; /* diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index b5d2a9fd46c7..61be85154dd1 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -703,8 +703,6 @@ errout: return err; } -#define INFINITY_LIFE_TIME 0xFFFFFFFF - static void check_lifetime(struct work_struct *work) { unsigned long now, next, next_sec, next_sched; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index c87d008aefa4..04ee75af2f6b 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -92,8 +92,6 @@ #include #include -#define INFINITY_LIFE_TIME 0xFFFFFFFF - #define IPV6_MAX_STRLEN \ sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")