From 0604595c16a6bf3c0aed131b80d1a25d5d74057d Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Mon, 7 Jul 2025 22:36:54 +0200 Subject: move limits for sNN/uNN types from kernel.h to limits.h Since we define the {s,u}{8,16,32,64} types the same way on all architectures, i.e. everybody uses asm-generic/int-ll64.h, we can just define the associated limit macros in terms of those for the corresponding types. This eliminates another set of limit macros that are not usable in #if conditionals. These type names and macros are not C or POSIX, so there's no language violation, but certainly a violation of developers' reasonable expectations. Signed-off-by: Rasmus Villemoes --- include/linux/kernel.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'include/linux/kernel.h') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f26274fbe1d..d3d979834ae 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -5,19 +5,6 @@ #include /* for printf/pr_* utilities */ #include -#define U8_MAX ((u8)~0U) -#define S8_MAX ((s8)(U8_MAX>>1)) -#define S8_MIN ((s8)(-S8_MAX - 1)) -#define U16_MAX ((u16)~0U) -#define S16_MAX ((s16)(U16_MAX>>1)) -#define S16_MIN ((s16)(-S16_MAX - 1)) -#define U32_MAX ((u32)~0U) -#define S32_MAX ((s32)(U32_MAX>>1)) -#define S32_MIN ((s32)(-S32_MAX - 1)) -#define U64_MAX ((u64)~0ULL) -#define S64_MAX ((s64)(U64_MAX>>1)) -#define S64_MIN ((s64)(-S64_MAX - 1)) - #define INT32_MAX S32_MAX #define STACK_MAGIC 0xdeadbeef -- cgit v1.2.3