[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260105-uapi-limits-v1-2-023bc7a13037@linutronix.de>
Date: Mon, 05 Jan 2026 09:26:48 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Andrew Lunn <andrew@...n.ch>, Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...filter.org>, Florian Westphal <fw@...len.de>,
Phil Sutter <phil@....cc>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, netfilter-devel@...r.kernel.org,
coreteam@...filter.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>
Subject: [PATCH RFC net-next 2/3] ethtool: uapi: Use UAPI definition of
INT_MAX
Using <limits.h> to gain access to INT_MAX introduces a dependency on a
libc, which UAPI headers should not do.
Use the equivalent UAPI constant.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
---
include/uapi/linux/ethtool.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index eb7ff2602fbb..9500236a9d2e 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -15,13 +15,10 @@
#define _UAPI_LINUX_ETHTOOL_H
#include <linux/const.h>
+#include <linux/limits.h>
#include <linux/types.h>
#include <linux/if_ether.h>
-#ifndef __KERNEL__
-#include <limits.h> /* for INT_MAX */
-#endif
-
/* All structures exposed to userland should be defined such that they
* have the same layout for 32-bit and 64-bit userland.
*/
@@ -2200,7 +2197,7 @@ enum ethtool_link_mode_bit_indices {
static inline int ethtool_validate_speed(__u32 speed)
{
- return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
+ return speed <= __KERNEL_INT_MAX || speed == (__u32)SPEED_UNKNOWN;
}
/* Duplex, half or full. */
--
2.52.0
Powered by blists - more mailing lists