From patchwork Fri Mar 15 20:48:04 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: 13593981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96A88C54E6A for ; Fri, 15 Mar 2024 20:48:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 806ED80147; Fri, 15 Mar 2024 16:48:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7695B800B4; Fri, 15 Mar 2024 16:48:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 56AA880147; Fri, 15 Mar 2024 16:48:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 405E1800B4 for ; Fri, 15 Mar 2024 16:48:32 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 19EEFC0959 for ; Fri, 15 Mar 2024 20:48:32 +0000 (UTC) X-FDA: 81900461664.28.E09796A Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by imf23.hostedemail.com (Postfix) with ESMTP id 55B1A140012 for ; Fri, 15 Mar 2024 20:48:30 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=FizCPf3S; dmarc=none; spf=pass (imf23.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710535710; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FbpW8OtDAenCttGekYaNBp6p0kgmPGbT5dc9uTJshoA=; b=1Wsntv1ppC8+JpVvq61q2CQ4ULd3kTrbd9NXiTpcmyWMQ81TaYx5WWfskO5djmrkJMMpd1 FG4p7xgm0lVlfDjB1UoT3Ee1UfLIAGPIZj09GBtqMcvqfZ3xcQNwyNLhCgaYMjc5n2uziA iCfRNu5bcDiR7ViPqb+WbhQxZQpMesg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=weissschuh.net header.s=mail header.b=FizCPf3S; dmarc=none; spf=pass (imf23.hostedemail.com: domain of linux@weissschuh.net designates 159.69.126.157 as permitted sender) smtp.mailfrom=linux@weissschuh.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710535710; a=rsa-sha256; cv=none; b=XogzPudlj1dQIlBVG6E0BmIp09tuCj5BhehBBCeXJ0B0pEuYP3NEgKhD4Fc9fRSfc5XYXw 1mVxgSIcTwnzGciaE9TWrcdn3b+nNj5NJyoqEDulV3jAkJ41EKlFP5mnsaGH7B5ZWoLVuL wZjBBTSNCkTzsDFBshQ4ZSbuzx4t4yA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1710535698; bh=yGyEnmkHG4K/QBZUE+wYC6PI0MysqQBf2jxKv03Uqeg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=FizCPf3SLAP8QJl7MKFLQmc5kz5/Ber5gPk8JnKK898Pgfacl6e7Q9zZ8wapuxDxV TQWvxZCydhPkPxx+WAYMk6TZp7HXP9SWmdfrZU1oYK6fsVpzjHLFaMHd2iiXqD6aYq mvnmhabBstRavzIG/FFHz4xiVL036JzBS8Q+3twI= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Fri, 15 Mar 2024 21:48:04 +0100 Subject: [PATCH 06/11] ipv4/sysctl: constify ctl_table arguments of utility functions MIME-Version: 1.0 Message-Id: <20240315-sysctl-const-handler-v1-6-1322ac7cb03d@weissschuh.net> References: <20240315-sysctl-const-handler-v1-0-1322ac7cb03d@weissschuh.net> In-Reply-To: <20240315-sysctl-const-handler-v1-0-1322ac7cb03d@weissschuh.net> To: Greg Kroah-Hartman , Kees Cook , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Muchun Song , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Simon Horman , Julian Anastasov , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Luis Chamberlain , Joel Granados , Catalin Marinas , Will Deacon , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Gerald Schaefer , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Phillip Potter , Theodore Ts'o , "Jason A. Donenfeld" , Sudip Mukherjee , Mark Rutland , Atish Patra , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , Jan Kara , Eric Biederman , Chandan Babu R , "Darrick J. Wong" , Steven Rostedt , Masami Hiramatsu , Peter Zijlstra , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Ian Rogers , Adrian Hunter , Balbir Singh , "Naveen N. Rao" , Anil S Keshavamurthy , Petr Mladek , John Ogness , Sergey Senozhatsky , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Andy Lutomirski , Will Drewry , John Stultz , Stephen Boyd , Mathieu Desnoyers , "Matthew Wilcox (Oracle)" , Roopa Prabhu , Nikolay Aleksandrov , Remi Denis-Courmont , Allison Henderson , Marcelo Ricardo Leitner , Xin Long , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Alexander Popov Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-fsdevel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-xfs@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, kexec@lists.infradead.org, bridge@lists.linux.dev, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, linux-sctp@vger.kernel.org, linux-nfs@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1710535695; l=1269; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=yGyEnmkHG4K/QBZUE+wYC6PI0MysqQBf2jxKv03Uqeg=; b=WplrulYKd7B5TGswqzcDZbw2m/RyDv+HhOXZKHSfdG38pZxdNlsfrZeeItPHEYHA5eD5Kt+EM V7+s8EbXwZLDElxohBqz8CxV4en1zqMOoIPQsYqfboOMLt8tzBvHJKe X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 55B1A140012 X-Stat-Signature: ozz8nda1nz8bqobqihpge741rigqsrde X-Rspam-User: X-HE-Tag: 1710535710-507824 X-HE-Meta: U2FsdGVkX1/TG9u65upJ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WqfGOF2h/ewC5QoQ71rQwxKDwAeKpFmdfBYo8kIYE0XxNjNCsWvk1q/D9u6RfSltYboTXrZtP6RW18mqdSFAE8EBDj3kj22HfKwS3eRjjiHXbtMXbwyr7ie9+btuaYwgkAl/ZrG3sFcof7/tvY7trlleGhLnOxWGQgAC+Cyuiv4Z7rd1KW4B01jvdqiAu6KDH5AlV//QVvy2PkoXovS+JU4yjmS15+qqAEhMX/MkYGhID+4DxKGGZi+Z+0UuW4g5tSFnrydyqwakVA4lEsr2oskend6B9uMFzGIEjiQEf20ANyiZnXExCOKn5JCBGvFiQGu3CHdZ2yBynrpeuBD1oi+UyP2lT6/7wEbM4ltgE4MbXxVTAVIwVkEC5FZNPP72GkHiOMCVkpchoidisgaaooWLR+YocuhqPCynmx1Tqd9viUUdmMETYtnIkV8gc68tQKz2lW93NU3qi/34SwIgKRvhMbmZZUKr4X62aDucR1ztkzWVSIbo6rv3VpZohM5ND1xYRH1TwKPJes1Qwnzs/qaImqnlYfd4CQPKh8Q1vL1hsU+bfQJ/vYllK1gIB3J3u9RSacRIKt7ngwtfK0eRuK5Uq/YGYW82ZCUhSfQkGwvflChc1qX3Fd2OLIX/37APOOXPku8oeKgq5edL+gbq0ytwOxgFzR+KaewILe2m6cyoY4VDFcMw8fI/B/Ik= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In a future commit the proc_handlers themselves will change to "const struct ctl_table". As a preparation for that adapt the internal helpers. Signed-off-by: Thomas Weißschuh --- net/ipv4/sysctl_net_ipv4.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 7e4f16a7dcc1..363dc2a487ac 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c @@ -130,7 +130,8 @@ static int ipv4_privileged_ports(struct ctl_table *table, int write, return ret; } -static void inet_get_ping_group_range_table(struct ctl_table *table, kgid_t *low, kgid_t *high) +static void inet_get_ping_group_range_table(const struct ctl_table *table, + kgid_t *low, kgid_t *high) { kgid_t *data = table->data; struct net *net = @@ -145,7 +146,8 @@ static void inet_get_ping_group_range_table(struct ctl_table *table, kgid_t *low } /* Update system visible IP port range */ -static void set_ping_group_range(struct ctl_table *table, kgid_t low, kgid_t high) +static void set_ping_group_range(const struct ctl_table *table, + kgid_t low, kgid_t high) { kgid_t *data = table->data; struct net *net =