Commit b3e90f37 authored by Yoann Congal's avatar Yoann Congal Committed by Petr Mladek

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: default avatarPetr Mladek <pmladek@suse.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Signed-off-by: default avatarYoann Congal <yoann.congal@smile.fr>
Link: https://lore.kernel.org/r/20240505080343.1471198-3-yoann.congal@smile.frSigned-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent 320bf431
...@@ -16,10 +16,10 @@ extern int pic_mode; ...@@ -16,10 +16,10 @@ extern int pic_mode;
* Summit or generic (i.e. installer) kernels need lots of bus entries. * Summit or generic (i.e. installer) kernels need lots of bus entries.
* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. * Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
*/ */
#if CONFIG_BASE_SMALL == 0 #ifdef CONFIG_BASE_SMALL
# define MAX_MP_BUSSES 260
#else
# define MAX_MP_BUSSES 32 # define MAX_MP_BUSSES 32
#else
# define MAX_MP_BUSSES 260
#endif #endif
#define MAX_IRQ_SOURCES 256 #define MAX_IRQ_SOURCES 256
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include <asm/unaligned.h> #include <asm/unaligned.h>
#define HEADER_SIZE 4u #define HEADER_SIZE 4u
#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) #define CON_BUF_SIZE (IS_ENABLED(CONFIG_BASE_SMALL) ? 256 : PAGE_SIZE)
/* /*
* Our minor space: * Our minor space:
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
/* /*
* This controls the default maximum pid allocated to a process * This controls the default maximum pid allocated to a process
*/ */
#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) #define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_SMALL) ? 0x1000 : 0x8000)
/* /*
* A maximum of 4 million PIDs should be enough for a while. * A maximum of 4 million PIDs should be enough for a while.
* [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.] * [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.]
*/ */
#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ #define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \
(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
/* /*
......
...@@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) ...@@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
} }
#define UDP_HTABLE_SIZE_MIN_PERNET 128 #define UDP_HTABLE_SIZE_MIN_PERNET 128
#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) #define UDP_HTABLE_SIZE_MIN (IS_ENABLED(CONFIG_BASE_SMALL) ? 128 : 256)
#define UDP_HTABLE_SIZE_MAX 65536 #define UDP_HTABLE_SIZE_MAX 65536
static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask) static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)
......
...@@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index) ...@@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index)
* doubled the number of slots per node, we'd get only 3 nodes per 4kB page. * doubled the number of slots per node, we'd get only 3 nodes per 4kB page.
*/ */
#ifndef XA_CHUNK_SHIFT #ifndef XA_CHUNK_SHIFT
#define XA_CHUNK_SHIFT (CONFIG_BASE_SMALL ? 4 : 6) #define XA_CHUNK_SHIFT (IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6)
#endif #endif
#define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT) #define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT)
#define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1) #define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1)
......
...@@ -743,7 +743,7 @@ config LOG_CPU_MAX_BUF_SHIFT ...@@ -743,7 +743,7 @@ config LOG_CPU_MAX_BUF_SHIFT
int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
depends on SMP depends on SMP
range 0 21 range 0 21
default 0 if BASE_SMALL != 0 default 0 if BASE_SMALL
default 12 default 12
depends on PRINTK depends on PRINTK
help help
...@@ -1945,9 +1945,7 @@ config RT_MUTEXES ...@@ -1945,9 +1945,7 @@ config RT_MUTEXES
default y if PREEMPT_RT default y if PREEMPT_RT
config BASE_SMALL config BASE_SMALL
int def_bool !BASE_FULL
default 0 if BASE_FULL
default 1 if !BASE_FULL
config MODULE_SIG_FORMAT config MODULE_SIG_FORMAT
def_bool n def_bool n
......
...@@ -1150,7 +1150,7 @@ static int __init futex_init(void) ...@@ -1150,7 +1150,7 @@ static int __init futex_init(void)
unsigned int futex_shift; unsigned int futex_shift;
unsigned long i; unsigned long i;
#if CONFIG_BASE_SMALL #ifdef CONFIG_BASE_SMALL
futex_hashsize = 16; futex_hashsize = 16;
#else #else
futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus()); futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus());
......
...@@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns); ...@@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns);
* when changing user ID's (ie setuid() and friends). * when changing user ID's (ie setuid() and friends).
*/ */
#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7) #define UIDHASH_BITS (IS_ENABLED(CONFIG_BASE_SMALL) ? 3 : 7)
#define UIDHASH_SZ (1 << UIDHASH_BITS) #define UIDHASH_SZ (1 << UIDHASH_BITS)
#define UIDHASH_MASK (UIDHASH_SZ - 1) #define UIDHASH_MASK (UIDHASH_SZ - 1)
#define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK) #define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment