* [PATCH net-next 1/5] net/neighbour: constify ctl_table arguments of utility function
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 ` Thomas Weißschuh
2024-05-27 17:04 ` [PATCH net-next 2/5] net/ipv4/sysctl: constify ctl_table arguments of utility functions Thomas Weißschuh
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-05-27 17:04 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Ahern, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
Jozsef Kadlecsik
Cc: Joel Granados, Luis Chamberlain, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam, Thomas Weißschuh
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/core/neighbour.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 45fd88405b6b..277751375b0a 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3578,7 +3578,7 @@ static void neigh_copy_dflt_parms(struct net *net, struct neigh_parms *p,
rcu_read_unlock();
}
-static void neigh_proc_update(struct ctl_table *ctl, int write)
+static void neigh_proc_update(const struct ctl_table *ctl, int write)
{
struct net_device *dev = ctl->extra1;
struct neigh_parms *p = ctl->extra2;
--
2.45.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 2/5] net/ipv4/sysctl: constify ctl_table arguments of utility functions
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
2024-05-27 17:04 ` [PATCH net-next 3/5] net/ipv6/addrconf: " Thomas Weißschuh
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-05-27 17:04 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Ahern, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
Jozsef Kadlecsik
Cc: Joel Granados, Luis Chamberlain, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam, Thomas Weißschuh
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 3/5] net/ipv6/addrconf: constify ctl_table arguments of utility functions
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 ` [PATCH net-next 2/5] net/ipv4/sysctl: constify ctl_table arguments of utility functions Thomas Weißschuh
@ 2024-05-27 17:04 ` 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
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-05-27 17:04 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Ahern, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
Jozsef Kadlecsik
Cc: Joel Granados, Luis Chamberlain, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam, Thomas Weißschuh
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/ipv6/addrconf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 5c424a0e7232..1e69756d53d9 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -863,7 +863,7 @@ static void addrconf_forward_change(struct net *net, __s32 newf)
}
}
-static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int newf)
+static int addrconf_fixup_forwarding(const struct ctl_table *table, int *p, int newf)
{
struct net *net;
int old;
@@ -931,7 +931,7 @@ static void addrconf_linkdown_change(struct net *net, __s32 newf)
}
}
-static int addrconf_fixup_linkdown(struct ctl_table *table, int *p, int newf)
+static int addrconf_fixup_linkdown(const struct ctl_table *table, int *p, int newf)
{
struct net *net;
int old;
@@ -6378,7 +6378,7 @@ static void addrconf_disable_change(struct net *net, __s32 newf)
}
}
-static int addrconf_disable_ipv6(struct ctl_table *table, int *p, int newf)
+static int addrconf_disable_ipv6(const struct ctl_table *table, int *p, int newf)
{
struct net *net = (struct net *)table->extra2;
int old;
@@ -6669,7 +6669,7 @@ void addrconf_disable_policy_idev(struct inet6_dev *idev, int val)
}
static
-int addrconf_disable_policy(struct ctl_table *ctl, int *valp, int val)
+int addrconf_disable_policy(const struct ctl_table *ctl, int *valp, int val)
{
struct net *net = (struct net *)ctl->extra2;
struct inet6_dev *idev;
--
2.45.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 4/5] net/ipv6/ndisc: constify ctl_table arguments of utility function
2024-05-27 17:04 [PATCH net-next 0/5] net: constify ctl_table arguments of utility functions Thomas Weißschuh
` (2 preceding siblings ...)
2024-05-27 17:04 ` [PATCH net-next 3/5] net/ipv6/addrconf: " Thomas Weißschuh
@ 2024-05-27 17:04 ` 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
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-05-27 17:04 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Ahern, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
Jozsef Kadlecsik
Cc: Joel Granados, Luis Chamberlain, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam, Thomas Weißschuh
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/ipv6/ndisc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d914b23256ce..254b192c5705 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1936,7 +1936,7 @@ static struct notifier_block ndisc_netdev_notifier = {
};
#ifdef CONFIG_SYSCTL
-static void ndisc_warn_deprecated_sysctl(struct ctl_table *ctl,
+static void ndisc_warn_deprecated_sysctl(const struct ctl_table *ctl,
const char *func, const char *dev_name)
{
static char warncomm[TASK_COMM_LEN];
--
2.45.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 5/5] ipvs: constify ctl_table arguments of utility functions
2024-05-27 17:04 [PATCH net-next 0/5] net: constify ctl_table arguments of utility functions Thomas Weißschuh
` (3 preceding siblings ...)
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 ` Thomas Weißschuh
2024-05-29 2:57 ` [PATCH net-next 0/5] net: " patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: Thomas Weißschuh @ 2024-05-27 17:04 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
David Ahern, Simon Horman, Julian Anastasov, Pablo Neira Ayuso,
Jozsef Kadlecsik
Cc: Joel Granados, Luis Chamberlain, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam, Thomas Weißschuh
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/netfilter/ipvs/ip_vs_ctl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index b6d0dcf3a5c3..78a1cc72dc38 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1924,7 +1924,8 @@ proc_do_sync_ports(struct ctl_table *table, int write,
return rc;
}
-static int ipvs_proc_est_cpumask_set(struct ctl_table *table, void *buffer)
+static int ipvs_proc_est_cpumask_set(const struct ctl_table *table,
+ void *buffer)
{
struct netns_ipvs *ipvs = table->extra2;
cpumask_var_t *valp = table->data;
@@ -1962,8 +1963,8 @@ static int ipvs_proc_est_cpumask_set(struct ctl_table *table, void *buffer)
return ret;
}
-static int ipvs_proc_est_cpumask_get(struct ctl_table *table, void *buffer,
- size_t size)
+static int ipvs_proc_est_cpumask_get(const struct ctl_table *table,
+ void *buffer, size_t size)
{
struct netns_ipvs *ipvs = table->extra2;
cpumask_var_t *valp = table->data;
--
2.45.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net-next 0/5] net: constify ctl_table arguments of utility functions
2024-05-27 17:04 [PATCH net-next 0/5] net: constify ctl_table arguments of utility functions Thomas Weißschuh
` (4 preceding siblings ...)
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 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-29 2:57 UTC (permalink / raw)
To: =?utf-8?q?Thomas_Wei=C3=9Fschuh_=3Clinux=40weissschuh=2Enet=3E?=
Cc: davem, edumazet, kuba, pabeni, dsahern, horms, ja, pablo, kadlec,
j.granados, mcgrof, netdev, linux-kernel, lvs-devel,
netfilter-devel, coreteam
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 27 May 2024 19:04:18 +0200 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net-next,1/5] net/neighbour: constify ctl_table arguments of utility function
https://git.kernel.org/netdev/net-next/c/874aa96d78c7
- [net-next,2/5] net/ipv4/sysctl: constify ctl_table arguments of utility functions
https://git.kernel.org/netdev/net-next/c/551814313f11
- [net-next,3/5] net/ipv6/addrconf: constify ctl_table arguments of utility functions
https://git.kernel.org/netdev/net-next/c/c55eb03765f4
- [net-next,4/5] net/ipv6/ndisc: constify ctl_table arguments of utility function
https://git.kernel.org/netdev/net-next/c/7a20cd1e71d8
- [net-next,5/5] ipvs: constify ctl_table arguments of utility functions
https://git.kernel.org/netdev/net-next/c/0a9f788fdde4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread