Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp773132lqh; Sun, 5 May 2024 01:04:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUz3dwhHLzwTHdSmRs453KD4r7HjPAvdfhUsfUQar6pyKSzJ3VOBZkBNNF2tTT+Q9jHPS6cDsrOK8NSvcdLmkMorBmEPY5CEV/2iliU0A== X-Google-Smtp-Source: AGHT+IEU9L/TwJK+afQYi/I6Ore9aUivtmGGpJQzGlSSBG29UI12wRR0MtlQZUqFZai8KaQyVjvU X-Received: by 2002:a05:6871:5b25:b0:23e:bf68:816a with SMTP id op37-20020a0568715b2500b0023ebf68816amr4607155oac.35.1714896294367; Sun, 05 May 2024 01:04:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714896294; cv=pass; d=google.com; s=arc-20160816; b=BbVS7eLP5qUv21CX/Z5FdtSL66k/IF073SuWkeAvB/2NEYOwhql1ahu4HOYHcjl5NF 8GuLqPjB65zsZ6w/QbBUssy03kdr3FMsJYWX8ysYQPsTTKfnjkWfGLt7WNsJaqlS58Wt DIEiWlNbOj4asksd+9bMfIs5EQL8+XgRM5y4tL61WcoJQlZGB9zJfqv/4smMBtv+819D 72gCHJp/SqMNwQ9Em9qdcRPOdUrAhtY3bnYSTz3qyvIeIO6c19PzdU8dA7HXIFDdO0tf jxppv+mbTFsxXOjhleKa99ZFzDDqWMcRil3JQaKqG1ewQEV7i7AKTjXGMql8gUOlDi8d XexA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=p7o3BmmVfC/sdIYcG0T60cpIrJuIdHYu3AhI1jZq65E=; fh=MSrlOI9CoQy2mOH1KvAkAywvtMCoYXR3aewmePYpFt4=; b=FntQ7AdkCmZmvZyRVqXK+K0pX94Z/CuIkBlXH2MSwbQrNqEh6ah7RLYkcIFYX3+7RF iXOqgDXkHERGZ12XGuqQzeHCAhU+GL/XN6+vND7f53PyYdGAxZw+Ko4AsBMHpZWzdAhx sW6QZ0iFnSmlFJDA4oTWw+w0JjfGITiqMVRHJFFl9VdHPDyIOuCyjlIM+zwWv8s2c7LM s3JGEDWPB0TVhcM9sNRXLzobXbC4JJEAzuSlUtwahCEEampZedhuO0Sv7CiGz7+E9r2U Iu8vxbp9TAzVboF992LkKRo0rvWPEn7tZ4PDKZ0Wuo0Avmgjwf3LNx4UmRZ4nC1yFxYU d1LQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=bo4uCXlj; arc=pass (i=1 spf=pass spfdomain=smile.fr dkim=pass dkdomain=smile-fr.20230601.gappssmtp.com dmarc=pass fromdomain=smile.fr); spf=pass (google.com: domain of linux-kernel+bounces-168915-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168915-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m13-20020a656a0d000000b005e2c2fc5125si6936427pgu.249.2024.05.05.01.04.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 01:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168915-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@smile-fr.20230601.gappssmtp.com header.s=20230601 header.b=bo4uCXlj; arc=pass (i=1 spf=pass spfdomain=smile.fr dkim=pass dkdomain=smile-fr.20230601.gappssmtp.com dmarc=pass fromdomain=smile.fr); spf=pass (google.com: domain of linux-kernel+bounces-168915-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168915-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=smile.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EF6FF281961 for ; Sun, 5 May 2024 08:04:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 009AB6112; Sun, 5 May 2024 08:04:21 +0000 (UTC) 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: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 E09B7B658 for ; Sun, 5 May 2024 08:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896259; cv=none; b=DtPEuiGuF20D8fCO0+qOf7c0lYVXBTnjhMr0XUsbmLDP0+J7c4E7ZlRegKchvM/8Iowf2cGTC+6yPuVzz3BPTvdIPgreFhCWHT2vrZJz2DM34BKFmqM9c3mkLIv7GWOYfLt/mTT3LRiYII4ZrrxQT0YZ1i4z34E50gXFvzSrzn8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714896259; c=relaxed/simple; bh=DE3O+6aSAqPE1MrCm+1zLDbZ4sdGsvibhhmEf+RvYoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kqXX0WJTbqndJKzCIorUq5NYdlJZ4Df3WzDDeSIwZJTLSYcl0+QTfR97681g6mKBWSUX07J9oDfWyl/hphwMbAa8hl2hOZyhRVt7dSLQDOg9W318X3c6wkuNqN3CVzrvs1/R/1HmXJGN+w8tibCZqysuh3INOb8N51Rd4PHqOag= 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.41 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 Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-41b782405bbso6934505e9.1 for ; Sun, 05 May 2024 01:04:17 -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=ak7PrS+naP0M/qgaLisKHdGVwLLb43cnUlgjcZIYWJjevutFW81nLEa9kL1LOGIPh0 b50wcpaYj5Wxlwk2KF5Pe0nkKi96Lg9x4ymEyHKDNFuF3BsELNxVJzVI2PXFVuZnNRp1 23oTijC+KmWbQ4SD3Jw6TDuvqkNWjA5mnfZh/NLc4XiqNV+s94tEB9q7pSftoQg7GgoO onmZokEijOqMp06A3xFZCi8H9VMs9btarq4xqPbZicZ4+PzGu1BJ7FPMEd4IGLcLSOut qGPGajeTBNRUY1r6LEk5AYSnHA8Y/eK7BEL2y6YT0lXQOwSQCk7lnaJPk9OLvB1PjnTt Hddg== X-Forwarded-Encrypted: i=1; AJvYcCUezQusD0w5qaOiOFP0gP0oi4/cq4TbFbDO/oeumqtR+78qRRUl8CC6QM6e1YOgPFPvW4zlZHvtZ2GUqSUCfHz+wbsXMEtYSIIP6u/Y X-Gm-Message-State: AOJu0YxIAWXe4rr/JZGmAPQT0/T7e+BRx+TmejspVqOhOnSQ8MyiGq40 eUF2ZgxAsnRU1QjETO9R7iFuerwwgegFBNfhoLTt0YnYHNyWJ95u8qC91q+rAG/j5eI7WnoZkCf Yi50VoQ== 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=20Almeida?= , 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) -- 2.39.2