History

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.

Rasmus Villemoes committed 5 years ago

Commit 32c93971 parent 8ba9d403 files · +1 −3Browse files

Unified · Split

3 files
  1. include/linux/cred.h +0 −1
  2. include/linux/init_task.h +0 −1
  3. kernel/cred.c +1 −1
include/linux/cred.h+0−1
@@ -53,7 +53,6 @@ do { \ · 52 unmodified lines
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+0−1
@@ -25,7 +25,6 @@ · 24 unmodified lines
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+1−1
@@ -33,7 +33,7 @@ do { \ · 32 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t