Skip to content

Commit 32c9397

Browse files
Villemoestorvalds
authored andcommitted
kernel/cred.c: make init_groups static
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>
1 parent 8ba9d40 commit 32c9397

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

‎include/linux/cred.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ do { \
5353
groups_free(group_info); \
5454
} while (0)
5555

56-
extern struct group_info init_groups;
5756
#ifdef CONFIG_MULTIUSER
5857
extern struct group_info *groups_alloc(int);
5958
extern void groups_free(struct group_info *);

‎include/linux/init_task.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
extern struct files_struct init_files;
2626
extern struct fs_struct init_fs;
2727
extern struct nsproxy init_nsproxy;
28-
extern struct group_info init_groups;
2928
extern struct cred init_cred;
3029

3130
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE

‎kernel/cred.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ do { \
3333
static struct kmem_cache *cred_jar;
3434

3535
/* init to 2 - one for init_task, one to ensure it is never freed */
36-
struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
36+
static struct group_info init_groups = { .usage = ATOMIC_INIT(2) };
3737

3838
/*
3939
* The initial credentials for the initial task

0 commit comments

Comments
 (0)