]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sunrpc: make the function arg as const
authorBhumika Goyal <bhumirks@gmail.com>
Tue, 17 Oct 2017 16:14:23 +0000 (18:14 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 27 Nov 2017 21:45:11 +0000 (16:45 -0500)
Make the struct cache_detail *tmpl argument of the function
cache_create_net as const as it is only getting passed to kmemup having
the argument as const void *.
Add const to the prototype too.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/cache.h
net/sunrpc/cache.c

index 270bad0e1bed137e9ce44727d9d79fde830e0006..40d2822f0e2f1d1a6aa1a84e2ec820a8f9df392e 100644 (file)
@@ -213,7 +213,7 @@ extern void __init cache_initialize(void);
 extern int cache_register_net(struct cache_detail *cd, struct net *net);
 extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
 
-extern struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct net *net);
+extern struct cache_detail *cache_create_net(const struct cache_detail *tmpl, struct net *net);
 extern void cache_destroy_net(struct cache_detail *cd, struct net *net);
 
 extern void sunrpc_init_cache_detail(struct cache_detail *cd);
index 79d55d949d9a794a1501aee45f4807e76c7bfa1d..e68943895be48e36f6225280b5f7510abb541dec 100644 (file)
@@ -1674,7 +1674,7 @@ void cache_unregister_net(struct cache_detail *cd, struct net *net)
 }
 EXPORT_SYMBOL_GPL(cache_unregister_net);
 
-struct cache_detail *cache_create_net(struct cache_detail *tmpl, struct net *net)
+struct cache_detail *cache_create_net(const struct cache_detail *tmpl, struct net *net)
 {
        struct cache_detail *cd;
        int i;