From patchwork Mon Jul 29 20:43:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13745772 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 DC4C716DEDA; Mon, 29 Jul 2024 20:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722285831; cv=none; b=tZXcUNNCMYmLLUEjINoCP1CxLtyOkL5yTotQxfzcVms+hV0tJMSMO+yTvvkwHeHPleQa2Xn1Ra8d1iiUKf9bKD/HorDN6RCSl6irxNKGn04c0HgXzXMhYNd6OklCWGIOdvs2nv5jSiZNqwFhAeHo0ZDJJV4EbB57ng4pRpyIN7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722285831; c=relaxed/simple; bh=qZXkT1m6kcK7yZXSMPzw5QiS2oUJ7uAmwCFZNL/ZQwc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pEqU6OXAOrqSv1efpUYohj1ow5fjiYsCxasdwcuLbVLwde8dBlUYdOj5Q46knL1p+Z11DhGy/WnBzOadZhAMkGfgQLTm0SF+EHFf4ZiiMcSZOLOhEkJCcVdkVO3Y0G+PnJVeCQfegk67rJQvA6x4UmloB0ZtlbZN+GY+bsutyck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=TAN57LSb; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="TAN57LSb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1722285818; bh=qZXkT1m6kcK7yZXSMPzw5QiS2oUJ7uAmwCFZNL/ZQwc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TAN57LSb24MSSTuw/+AQnemeLldOcxXfpH8wQCnzQwDOOJTH4YZfKfOHRBfB3Eahs OMKklB3As9UZsnU886s/yKG7aTPgMqZ/Yh/W5TrqXxiJgLt/CVs5ow46CVDRn5wYLJ tD6NRhKA8WZp2c8ZZQ+MYKpFFLJfQ8ZSEvfOynhk= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 29 Jul 2024 22:43:33 +0200 Subject: [PATCH 4/5] sysctl: make internal ctl_tables const Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240729-sysctl-const-api-v1-4-ca628c7a942c@weissschuh.net> References: <20240729-sysctl-const-api-v1-0-ca628c7a942c@weissschuh.net> In-Reply-To: <20240729-sysctl-const-api-v1-0-ca628c7a942c@weissschuh.net> To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Luis Chamberlain , Kees Cook , Joel Granados Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1722285818; l=1106; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=qZXkT1m6kcK7yZXSMPzw5QiS2oUJ7uAmwCFZNL/ZQwc=; b=LdQo1qto1d9jseDguzEBJD+8pNzCLgH7Su6S6XVBOzUVXTKdyotcY4uMr2iFMoaglir/9clog j3nxiIXB96UAyeTsjjAw+xLhp4lmp4dJ/xLcV6KfnGqe89Z7Bzc4Pj3 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Now that the sysctl core can handle registration of "const struct ctl_table" constify the sysctl internal tables. Signed-off-by: Thomas Weißschuh --- fs/proc/proc_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 01e006cc1163..c6cf21436d6c 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -30,7 +30,7 @@ static const struct file_operations proc_sys_dir_file_operations; static const struct inode_operations proc_sys_dir_operations; /* Support for permanently empty directories */ -static struct ctl_table sysctl_mount_point[] = { }; +static const struct ctl_table sysctl_mount_point[] = { }; /** * register_sysctl_mount_point() - registers a sysctl mount point @@ -62,7 +62,7 @@ void proc_sys_poll_notify(struct ctl_table_poll *poll) wake_up_interruptible(&poll->wait); } -static struct ctl_table root_table[] = { +static const struct ctl_table root_table[] = { { .procname = "", .mode = S_IFDIR|S_IRUGO|S_IXUGO,