aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/net_namespace.c
diff options
context:
space:
mode:
authorGuillaume Nault <gnault@redhat.com>2020-01-16 21:16:46 +0100
committerDavid S. Miller <davem@davemloft.net>2020-01-17 13:25:24 +0100
commit56f200c78ce4d94680a27a1ce97a29ebeb4f23e1 (patch)
treec8434a55561d9dcfba61eb2df44318f57778b552 /net/core/net_namespace.c
parentnet: dsa: felix: Don't error out on disabled ports with no phy-mode (diff)
downloadlinux-dev-56f200c78ce4d94680a27a1ce97a29ebeb4f23e1.tar.xz
linux-dev-56f200c78ce4d94680a27a1ce97a29ebeb4f23e1.zip
netns: Constify exported functions
Mark function parameters as 'const' where possible. Signed-off-by: Guillaume Nault <gnault@redhat.com> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/core/net_namespace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 6412c1fbfcb5..757cc1d084e7 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -268,7 +268,7 @@ int peernet2id_alloc(struct net *net, struct net *peer, gfp_t gfp)
EXPORT_SYMBOL_GPL(peernet2id_alloc);
/* This function returns, if assigned, the id of a peer netns. */
-int peernet2id(struct net *net, struct net *peer)
+int peernet2id(const struct net *net, struct net *peer)
{
int id;
@@ -283,12 +283,12 @@ EXPORT_SYMBOL(peernet2id);
/* This function returns true is the peer netns has an id assigned into the
* current netns.
*/
-bool peernet_has_id(struct net *net, struct net *peer)
+bool peernet_has_id(const struct net *net, struct net *peer)
{
return peernet2id(net, peer) >= 0;
}
-struct net *get_net_ns_by_id(struct net *net, int id)
+struct net *get_net_ns_by_id(const struct net *net, int id)
{
struct net *peer;