Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

printk: Change type of CONFIG_BASE_SMALL to bool

CONFIG_BASE_SMALL is currently a type int but is only used as a boolean.

So, change its type to bool and adapt all usages:
CONFIG_BASE_SMALL == 0 becomes !IS_ENABLED(CONFIG_BASE_SMALL) and
CONFIG_BASE_SMALL != 0 becomes IS_ENABLED(CONFIG_BASE_SMALL).

Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Link: https://lore.kernel.org/r/20240505080343.1471198-3-yoann.congal@smile.fr
Signed-off-by: Petr Mladek <pmladek@suse.com>

authored by

Yoann Congal and committed by
Petr Mladek
b3e90f37 320bf431

+12 -14
+3 -3
arch/x86/include/asm/mpspec.h
··· 16 16 * Summit or generic (i.e. installer) kernels need lots of bus entries. 17 17 * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. 18 18 */ 19 - #if CONFIG_BASE_SMALL == 0 20 - # define MAX_MP_BUSSES 260 21 - #else 19 + #ifdef CONFIG_BASE_SMALL 22 20 # define MAX_MP_BUSSES 32 21 + #else 22 + # define MAX_MP_BUSSES 260 23 23 #endif 24 24 25 25 #define MAX_IRQ_SOURCES 256
+1 -1
drivers/tty/vt/vc_screen.c
··· 51 51 #include <asm/unaligned.h> 52 52 53 53 #define HEADER_SIZE 4u 54 - #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) 54 + #define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_SMALL) ? 256 : PAGE_SIZE) 55 55 56 56 /* 57 57 * Our minor space:
+2 -2
include/linux/threads.h
··· 25 25 /* 26 26 * This controls the default maximum pid allocated to a process 27 27 */ 28 - #define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) 28 + #define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_SMALL) ? 0x1000 : 0x8000) 29 29 30 30 /* 31 31 * A maximum of 4 million PIDs should be enough for a while. 32 32 * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.] 33 33 */ 34 - #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ 34 + #define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \ 35 35 (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) 36 36 37 37 /*
+1 -1
include/linux/udp.h
··· 24 24 } 25 25 26 26 #define UDP_HTABLE_SIZE_MIN_PERNET 128 27 - #define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) 27 + #define UDP_HTABLE_SIZE_MIN (IS_ENABLED(CONFIG_BASE_SMALL) ? 128 : 256) 28 28 #define UDP_HTABLE_SIZE_MAX 65536 29 29 30 30 static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
+1 -1
include/linux/xarray.h
··· 1141 1141 * doubled the number of slots per node, we'd get only 3 nodes per 4kB page. 1142 1142 */ 1143 1143 #ifndef XA_CHUNK_SHIFT 1144 - #define XA_CHUNK_SHIFT (CONFIG_BASE_SMALL ? 4 : 6) 1144 + #define XA_CHUNK_SHIFT (IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6) 1145 1145 #endif 1146 1146 #define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT) 1147 1147 #define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1)
+2 -4
init/Kconfig
··· 743 743 int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" 744 744 depends on SMP 745 745 range 0 21 746 - default 0 if BASE_SMALL != 0 746 + default 0 if BASE_SMALL 747 747 default 12 748 748 depends on PRINTK 749 749 help ··· 1945 1945 default y if PREEMPT_RT 1946 1946 1947 1947 config BASE_SMALL 1948 - int 1949 - default 0 if BASE_FULL 1950 - default 1 if !BASE_FULL 1948 + def_bool !BASE_FULL 1951 1949 1952 1950 config MODULE_SIG_FORMAT 1953 1951 def_bool n
+1 -1
kernel/futex/core.c
··· 1150 1150 unsigned int futex_shift; 1151 1151 unsigned long i; 1152 1152 1153 - #if CONFIG_BASE_SMALL 1153 + #ifdef CONFIG_BASE_SMALL 1154 1154 futex_hashsize = 16; 1155 1155 #else 1156 1156 futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus());
+1 -1
kernel/user.c
··· 88 88 * when changing user ID's (ie setuid() and friends). 89 89 */ 90 90 91 - #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) 91 + #define UIDHASH_BITS (IS_ENABLED(CONFIG_BASE_SMALL) ? 3 : 7) 92 92 #define UIDHASH_SZ (1 << UIDHASH_BITS) 93 93 #define UIDHASH_MASK (UIDHASH_SZ - 1) 94 94 #define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)