kernel/cred.c: make init_groups static
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 7 May 2021 01:02:39 +0000 (18:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 7 May 2021 02:24:11 +0000 (19:24 -0700)
init_groups is declared in both cred.h and init_task.h, but it is not
actually referenced anywhere outside of cred.c where it is defined.  So
make it static and remove the declarations.

Link: https://lkml.kernel.org/r/20210310220102.2484201-1-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/cred.h
include/linux/init_task.h
kernel/cred.c

index ac0e5f97d7d8d39519f896c780cf26c2f0a73e53..14971322e1a05b488c2be3e4d2a4bd08f707c0da 100644 (file)
@@ -53,7 +53,6 @@ do {                                                  \
                groups_free(group_info);                \
 } while (0)
 
-extern struct group_info init_groups;
 #ifdef CONFIG_MULTIUSER
 extern struct group_info *groups_alloc(int);
 extern void groups_free(struct group_info *);
index b2412b4d4c20e253b35c084403fc20825529bf19..40fc5813cf9321d76856b66d470be5e81ce28306 100644 (file)
@@ -25,7 +25,6 @@
 extern struct files_struct init_files;
 extern struct fs_struct init_fs;
 extern struct nsproxy init_nsproxy;
-extern struct group_info init_groups;
 extern struct cred init_cred;
 
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
index 421b1149c6516004221159824dc6c18770db64e6..e1d274cd741be424e1d05be65152e5fc7a4c853b 100644 (file)
@@ -33,7 +33,7 @@ do {                                                                  \
 static struct kmem_cache *cred_jar;
 
 /* init to 2 - one for init_task, one to ensure it is never freed */
-struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
+static struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
 
 /*
  * The initial credentials for the initial task