From patchwork Sun May 5 08:03:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoann Congal X-Patchwork-Id: 13654198 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 743A9B67F for ; Sun, 5 May 2024 08:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896260; cv=none; b=NthTiKT4AfnmzOD+vulj01U0jz4bgAI5Go3E1CeAMbZN5jRVQe2yXn7RECKWNbmX8NMSUy/Os4Zr0IjbZVPk5aeargSTY2l/vdQs4wNxAaVLTg7ZoLbfy0fgo/YXFe0qYPvjYSyaI6S4JtsuhfKZJfIXekcpTwrFSgtz0NUsv+k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896260; c=relaxed/simple; bh=DE3O+6aSAqPE1MrCm+1zLDbZ4sdGsvibhhmEf+RvYoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PpDOEbAKVYkJpANWsxzDV83f3TIzoRbyVqDUKciAk3jes1k3VG2C5J7d5tH5hiSqNr1nTF7ggY7IQzf7FR8lnbF+lf31ntapxc9TxPcpukhv5vQw/LjSr1e/wio8IPzwuvriwiFc1QZwRI/dE6OcRTuTFl3j2IK/mDzAeyCR0JE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=smile.fr; spf=pass smtp.mailfrom=smile.fr; dkim=pass (2048-bit key) header.d=smile-fr.20230601.gappssmtp.com header.i=@smile-fr.20230601.gappssmtp.com header.b=bo4uCXlj; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=smile.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=smile.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=smile-fr.20230601.gappssmtp.com header.i=@smile-fr.20230601.gappssmtp.com header.b="bo4uCXlj" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-41b782405bbso6934575e9.1 for ; Sun, 05 May 2024 01:04:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=smile-fr.20230601.gappssmtp.com; s=20230601; t=1714896256; x=1715501056; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p7o3BmmVfC/sdIYcG0T60cpIrJuIdHYu3AhI1jZq65E=; b=bo4uCXljRt+euBsOtZ61Z7SBDz3rJa/+X5SUZ4cG6qK7XCgorNeIDMOkxHfb8opadL 7N/MZauQN2DF84usX0f9PFHgy0yoMyRJBOaeS1RNn4jbbTwqdBwd3iW7GstIH8fotUIk yzp9+PaiUd/NUKAyh1fBSOUfPQAHJ7Uf2sdXr0d+OqpEDuxnQtHTRbtuW2oXYNdTBxij WzSbC8kIbs+PlbH18jE8Gf/ErGQEb4Sb/4vHJ8Ll/BSen1mW5iG4xjQZlw+7u9rfN30k yA0b2XlRC8OWjBAFq8C3+Rg/tIqKpHmy09vH7p/rQWPYyxaK4LPE7BI4aFzVxuVqnv1g 7Y4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714896256; x=1715501056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p7o3BmmVfC/sdIYcG0T60cpIrJuIdHYu3AhI1jZq65E=; b=VxQG14c6fguhC8la1KGwrWSgBuGAFKnQDyRrR4/oS8Jsl3fFVPLN0n7eWxFNg1dT/l e4I/6WdV8L9yjMTfp/6K3bEDCH3y4BvWYZzRjneyYvrnGBSP/HOsDGHxIvfWqXJyfwvs pEphQTu9MUIGKTE+XT4V63BTHZ34CVlzpO/V7GBfc7NeMPePrEi+9mKuJ/lxf+lAmj6G A6iikG6jM+PRVL96RTFZKffhzIxevctjUkcv4Ag4aRAQ7nIY7CO+r7sW9Tay9RZN5tXC RI3cC88185tCmu5bS/yc9I+FWvP95jJeaQ4fZpVomkREbPdnkJZVk/bxEZItAzCF5B4+ WaBA== X-Gm-Message-State: AOJu0YwAbVvRcd08kWqdiBwIB0QSmOxpirO6BeKhs8lNRnTbIPXQ0HH8 uA72n8bYeXh0JjEPdN33syZYjM7Tc3o+Lbv0vtFYs+BYOBCtj5N788oxAGGBcG0YVCC/qWxN7Ll I/Z5Dwg== X-Google-Smtp-Source: AGHT+IGaMUzSwGNxOEDo4BmFXoH3bc0KpI2QztF++hIPoIHqz/JaOrisVmhmMg4N095xkstKkWR5vA== X-Received: by 2002:a05:600c:358a:b0:41e:454b:2f7 with SMTP id p10-20020a05600c358a00b0041e454b02f7mr3495761wmq.23.1714896256246; Sun, 05 May 2024 01:04:16 -0700 (PDT) Received: from P-ASN-ECS-830T8C3.local ([89.159.1.53]) by smtp.gmail.com with ESMTPSA id s3-20020adfe003000000b0034e8a10039esm4705295wrh.10.2024.05.05.01.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 01:04:15 -0700 (PDT) From: yoann.congal@smile.fr To: linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, x86@kernel.org Cc: =?utf-8?q?Andr=C3=A9_Almeida?= , Borislav Petkov , Darren Hart , Dave Hansen , Davidlohr Bueso , Geert Uytterhoeven , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Jiri Slaby , John Ogness , Josh Triplett , Masahiro Yamada , Matthew Wilcox , Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Willem de Bruijn , Yoann Congal Subject: [PATCH RESEND v6 2/3] printk: Change type of CONFIG_BASE_SMALL to bool Date: Sun, 5 May 2024 10:03:42 +0200 Message-Id: <20240505080343.1471198-3-yoann.congal@smile.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240505080343.1471198-1-yoann.congal@smile.fr> References: <20240505080343.1471198-1-yoann.congal@smile.fr> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Yoann Congal 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 Reviewed-by: Greg Kroah-Hartman Reviewed-by: Masahiro Yamada Signed-off-by: Yoann Congal --- arch/x86/include/asm/mpspec.h | 6 +++--- drivers/tty/vt/vc_screen.c | 2 +- include/linux/threads.h | 4 ++-- include/linux/udp.h | 2 +- include/linux/xarray.h | 2 +- init/Kconfig | 6 ++---- kernel/futex/core.c | 2 +- kernel/user.c | 2 +- 8 files changed, 12 insertions(+), 14 deletions(-) diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 4b0f98a8d338d..c01d3105840cf 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -15,10 +15,10 @@ extern int pic_mode; * 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. */ -#if CONFIG_BASE_SMALL == 0 -# define MAX_MP_BUSSES 260 -#else +#ifdef CONFIG_BASE_SMALL # define MAX_MP_BUSSES 32 +#else +# define MAX_MP_BUSSES 260 #endif #define MAX_IRQ_SOURCES 256 diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c index 67e2cb7c96eec..da33c6c4691c0 100644 --- a/drivers/tty/vt/vc_screen.c +++ b/drivers/tty/vt/vc_screen.c @@ -51,7 +51,7 @@ #include #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: diff --git a/include/linux/threads.h b/include/linux/threads.h index c34173e6c5f18..1674a471b0b4c 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h @@ -25,13 +25,13 @@ /* * 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. * [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)) /* diff --git a/include/linux/udp.h b/include/linux/udp.h index d04188714dca1..b456417fb4515 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h @@ -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 (CONFIG_BASE_SMALL ? 128 : 256) +#define UDP_HTABLE_SIZE_MIN (IS_ENABLED(CONFIG_BASE_SMALL) ? 128 : 256) #define UDP_HTABLE_SIZE_MAX 65536 static inline u32 udp_hashfn(const struct net *net, u32 num, u32 mask) diff --git a/include/linux/xarray.h b/include/linux/xarray.h index cb571dfcf4b16..3f81ee5f9fb9c 100644 --- a/include/linux/xarray.h +++ b/include/linux/xarray.h @@ -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. */ #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 #define XA_CHUNK_SIZE (1UL << XA_CHUNK_SHIFT) #define XA_CHUNK_MASK (XA_CHUNK_SIZE - 1) diff --git a/init/Kconfig b/init/Kconfig index ad4b6f778d2bd..182f2671a49dd 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -743,7 +743,7 @@ config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP range 0 21 - default 0 if BASE_SMALL != 0 + default 0 if BASE_SMALL default 12 depends on PRINTK help @@ -1950,9 +1950,7 @@ config RT_MUTEXES default y if PREEMPT_RT config BASE_SMALL - int - default 0 if BASE_FULL - default 1 if !BASE_FULL + def_bool !BASE_FULL config MODULE_SIG_FORMAT def_bool n diff --git a/kernel/futex/core.c b/kernel/futex/core.c index 1e78ef24321e8..06a1f091be81d 100644 --- a/kernel/futex/core.c +++ b/kernel/futex/core.c @@ -1150,7 +1150,7 @@ static int __init futex_init(void) unsigned int futex_shift; unsigned long i; -#if CONFIG_BASE_SMALL +#ifdef CONFIG_BASE_SMALL futex_hashsize = 16; #else futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus()); diff --git a/kernel/user.c b/kernel/user.c index 03cedc366dc9e..aa1162deafe49 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(init_user_ns); * 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_MASK (UIDHASH_SZ - 1) #define __uidhashfn(uid) (((uid >> UIDHASH_BITS) + uid) & UIDHASH_MASK)