Skip to content

Commit b3e90f3

Browse files
ycongal-smilepmladek
authored andcommitted
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 <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Masahiro Yamada <[email protected]> Signed-off-by: Yoann Congal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
1 parent 320bf43 commit b3e90f3

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

arch/x86/include/asm/mpspec.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ extern int pic_mode;
1616
* Summit or generic (i.e. installer) kernels need lots of bus entries.
1717
* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets.
1818
*/
19-
#if CONFIG_BASE_SMALL == 0
20-
# define MAX_MP_BUSSES 260
21-
#else
19+
#ifdef CONFIG_BASE_SMALL
2220
# define MAX_MP_BUSSES 32
21+
#else
22+
# define MAX_MP_BUSSES 260
2323
#endif
2424

2525
#define MAX_IRQ_SOURCES 256

drivers/tty/vt/vc_screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include <asm/unaligned.h>
5252

5353
#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)
5555

5656
/*
5757
* Our minor space:

include/linux/threads.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
/*
2626
* This controls the default maximum pid allocated to a process
2727
*/
28-
#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
28+
#define PID_MAX_DEFAULT (IS_ENABLED(CONFIG_BASE_SMALL) ? 0x1000 : 0x8000)
2929

3030
/*
3131
* A maximum of 4 million PIDs should be enough for a while.
3232
* [NOTE: PID/TIDs are limited to 2^30 ~= 1 billion, see FUTEX_TID_MASK.]
3333
*/
34-
#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
34+
#define PID_MAX_LIMIT (IS_ENABLED(CONFIG_BASE_SMALL) ? PAGE_SIZE * 8 : \
3535
(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
3636

3737
/*

include/linux/udp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
2424
}
2525

2626
#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)
2828
#define UDP_HTABLE_SIZE_MAX 65536
2929

3030
static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask)

include/linux/xarray.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ static inline void xa_release(struct xarray *xa, unsigned long index)
11411141
* doubled the number of slots per node, we'd get only 3 nodes per 4kB page.
11421142
*/
11431143
#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)
11451145
#endif
11461146
#define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT)
11471147
#define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1)

init/Kconfig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ config LOG_CPU_MAX_BUF_SHIFT
743743
int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)"
744744
depends on SMP
745745
range 0 21
746-
default 0 if BASE_SMALL != 0
746+
default 0 if BASE_SMALL
747747
default 12
748748
depends on PRINTK
749749
help
@@ -1945,9 +1945,7 @@ config RT_MUTEXES
19451945
default y if PREEMPT_RT
19461946

19471947
config BASE_SMALL
1948-
int
1949-
default 0 if BASE_FULL
1950-
default 1 if !BASE_FULL
1948+
def_bool !BASE_FULL
19511949

19521950
config MODULE_SIG_FORMAT
19531951
def_bool n

kernel/futex/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ static int __init futex_init(void)
11501150
unsigned int futex_shift;
11511151
unsigned long i;
11521152

1153-
#if CONFIG_BASE_SMALL
1153+
#ifdef CONFIG_BASE_SMALL
11541154
futex_hashsize = 16;
11551155
#else
11561156
futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus());

kernel/user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns);
8888
* when changing user ID's (ie setuid() and friends).
8989
*/
9090

91-
#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 7)
91+
#define UIDHASH_BITS (IS_ENABLED(CONFIG_BASE_SMALL) ? 3 : 7)
9292
#define UIDHASH_SZ (1 << UIDHASH_BITS)
9393
#define UIDHASH_MASK (UIDHASH_SZ - 1)
9494
#define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)

0 commit comments

Comments
 (0)