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.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -15,13 +15,10 @@ · 14 unmodified lines | |||
| 15 | #define _UAPI_LINUX_ETHTOOL_H | 15 | #define _UAPI_LINUX_ETHTOOL_H |
| 16 | 16 | ||
| 17 | #include <linux/const.h> | 17 | #include <linux/const.h> |
| 18 | #include <linux/typelimits.h> | ||
| 18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 19 | #include <linux/if_ether.h> | 20 | #include <linux/if_ether.h> |
| 20 | 21 | ||
| 21 | #ifndef __KERNEL__ | ||
| 22 | #include <limits.h> /* for INT_MAX */ | ||
| 23 | #endif | ||
| 24 | |||
| 25 | /* All structures exposed to userland should be defined such that they | 22 | /* All structures exposed to userland should be defined such that they |
| 26 | * have the same layout for 32-bit and 64-bit userland. | 23 | * have the same layout for 32-bit and 64-bit userland. |
| 27 | */ | 24 | */ |
| @@ -2216,7 +2213,7 @@ enum ethtool_link_mode_bit_indices { · 2188 unmodified lines | |||
| 2216 | 2213 | ||
| 2217 | static inline int ethtool_validate_speed(__u32 speed) | 2214 | static inline int ethtool_validate_speed(__u32 speed) |
| 2218 | { | 2215 | { |
| 2219 | return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN; | 2216 | return speed <= __KERNEL_INT_MAX || speed == (__u32)SPEED_UNKNOWN; |
| 2220 | } | 2217 | } |
| 2221 | 2218 | ||
| 2222 | /* Duplex, half or full. */ | 2219 | /* Duplex, half or full. */ |