netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>,
	 Simon Horman <horms@verge.net.au>, Julian Anastasov <ja@ssi.bg>,
	 Pablo Neira Ayuso <pablo@netfilter.org>,
	 Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: "Joel Granados" <j.granados@samsung.com>,
	"Luis Chamberlain" <mcgrof@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, "Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH net-next 2/5] net/ipv4/sysctl: constify ctl_table arguments of utility functions
Date: Mon, 27 May 2024 19:04:20 +0200	[thread overview]
Message-ID: <20240527-sysctl-const-handler-net-v1-2-16523767d0b2@weissschuh.net> (raw)
In-Reply-To: <20240527-sysctl-const-handler-net-v1-0-16523767d0b2@weissschuh.net>

The sysctl core is preparing to only expose instances of
struct ctl_table as "const".
This will also affect the ctl_table argument of sysctl handlers.

As the function prototype of all sysctl handlers throughout the tree
needs to stay consistent that change will be done in one commit.

To reduce the size of that final commit, switch utility functions which
are not bound by "typedef proc_handler" to "const struct ctl_table".

No functional change.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 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 162a0a3b6ba5..d7892f34a15b 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 =

-- 
2.45.1


  parent reply	other threads:[~2024-05-27 17:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 17:04 [PATCH net-next 0/5] net: constify ctl_table arguments of utility functions Thomas Weißschuh
2024-05-27 17:04 ` [PATCH net-next 1/5] net/neighbour: constify ctl_table arguments of utility function Thomas Weißschuh
2024-05-27 17:04 ` Thomas Weißschuh [this message]
2024-05-27 17:04 ` [PATCH net-next 3/5] net/ipv6/addrconf: constify ctl_table arguments of utility functions Thomas Weißschuh
2024-05-27 17:04 ` [PATCH net-next 4/5] net/ipv6/ndisc: constify ctl_table arguments of utility function Thomas Weißschuh
2024-05-27 17:04 ` [PATCH net-next 5/5] ipvs: constify ctl_table arguments of utility functions Thomas Weißschuh
2024-05-29  2:57 ` [PATCH net-next 0/5] net: " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240527-sysctl-const-handler-net-v1-2-16523767d0b2@weissschuh.net \
    --to=linux@weissschuh.net \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@verge.net.au \
    --cc=j.granados@samsung.com \
    --cc=ja@ssi.bg \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).