From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40D7C472771 for ; Fri, 7 Aug 2026 15:48:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117682; cv=none; b=jUJUDhS8jSbkwX5H8PTu4hTFJnPE+1HdKNWppTdqysZr0VVdVvWZCTqoo/TDLfJamNXjm29XmgOP2q5cf596o0WVoFHU0EIsVSQvarbwwXc+yKBW52ByquuH6hqWS2lPQ7sn424Kc8ITG8zYXyV+9lqt3goUJ8e5B+f2YMm5D1o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786117682; c=relaxed/simple; bh=hnQRv0v8dlrf2CivJZrATMlI0T3S61/7HpdSnStBXLQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=MVVcG4kL2IPDW07IVMgXvTY/7g6D4N/OthpVlb4k9LTxvheqaQxN9ld8Kpl7f2cHx6KyeWDCNk1KIe6MfHSPTUUWzp6SvLA8t+ME8G2onpYAOqg71ot9abEqhnY/kSdVvK5CtlXNFpt5UNNrm4Mj0+4s8udZm0K+XLPgUCbOFM4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OeTkxmkP; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OeTkxmkP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786117679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=dWrBipDaBv4kGCO5kxm6xkLfGZ7vC0QgSaDuvMrjwr4=; b=OeTkxmkPrWhDCGEf6Wue5rY57VHsXvmECW2tEtNlVsVna/Tqqh+nG3NxknsidfEqOSYvZG GYZLkLl6y7pK9NlVHIyl9+hHGgeHXQqQQBI1MkNNNBBjOl971kp4VLW76gQZ3KyP7KcMlB VoNwlVJLBZsZ7BsQcra7EP74Ud6zJEs= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-252-Ilgj7fUrMFSlBfe5Kgfgzg-1; Fri, 07 Aug 2026 11:47:51 -0400 X-MC-Unique: Ilgj7fUrMFSlBfe5Kgfgzg-1 X-Mimecast-MFC-AGG-ID: Ilgj7fUrMFSlBfe5Kgfgzg_1786117669 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 679901956089; Fri, 7 Aug 2026 15:47:49 +0000 (UTC) Received: from fedora (unknown [10.44.32.54]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 056A7195DF93; Fri, 7 Aug 2026 15:47:45 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 7 Aug 2026 17:47:48 +0200 (CEST) Date: Fri, 7 Aug 2026 17:47:44 +0200 From: Oleg Nesterov To: Joel Granados Cc: Mark Brown , Luis Chamberlain , Sudip Mukherjee , Alexander Viro , Christian Brauner , Jan Kara , Kees Cook , linux-kernel@vger.kernel.org Subject: [PATCH sysctl-next 1/2] sysctl: collapse redundant CONFIG_SYSCTL nesting in kernel/sysctl.c Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 After the removal of CONFIG_PROC_SYSCTL, several #ifdef CONFIG_SYSCTL blocks ended up nested inside the outer (now the same) CONFIG_SYSCTL guards. Collapse them and remove a now-stale "/proc/sys support" comment which referred to CONFIG_PROC_SYSCTL. Signed-off-by: Oleg Nesterov --- kernel/sysctl.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f7b75985d542..d0a612c65b08 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -29,14 +29,12 @@ EXPORT_SYMBOL(sysctl_vals); const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX }; EXPORT_SYMBOL_GPL(sysctl_long_vals); -#if defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL /* Constants used for minimum and maximum */ static const int ngroups_max = NGROUPS_MAX; static const int cap_last_cap = CAP_LAST_CAP; -#ifdef CONFIG_SYSCTL - /** * enum sysctl_writes_mode - supported sysctl write modes * @@ -64,14 +62,6 @@ enum sysctl_writes_mode { }; static enum sysctl_writes_mode sysctl_writes_strict = SYSCTL_WRITES_STRICT; -#endif /* CONFIG_SYSCTL */ -#endif /* CONFIG_SYSCTL */ - -/* - * /proc/sys support - */ - -#ifdef CONFIG_SYSCTL static int _proc_do_string(char *data, int maxlen, int dir, char *buffer, size_t *lenp, loff_t *ppos) @@ -1366,7 +1356,7 @@ int proc_do_large_bitmap(const struct ctl_table *table, int dir, #endif /* CONFIG_SYSCTL */ -#if defined(CONFIG_SYSCTL) +#ifdef CONFIG_SYSCTL int proc_do_static_key(const struct ctl_table *table, int dir, void *buffer, size_t *lenp, loff_t *ppos) { @@ -1398,7 +1388,6 @@ int proc_do_static_key(const struct ctl_table *table, int dir, } static const struct ctl_table sysctl_subsys_table[] = { -#ifdef CONFIG_SYSCTL { .procname = "sysctl_writes_strict", .data = &sysctl_writes_strict, @@ -1408,7 +1397,6 @@ static const struct ctl_table sysctl_subsys_table[] = { .extra1 = SYSCTL_NEG_ONE, .extra2 = SYSCTL_ONE, }, -#endif { .procname = "ngroups_max", .data = (void *)&ngroups_max, base-commit: 8d75c338f0bcecaa6c9af67f86c176b67b6acf3e -- 2.52.0