Extern declarations in .c files are a bad style and can lead to mismatches. Use existing definitions in headers where they exist, and otherwise move the external declarations to suitable header files.
Showing the changes to kernel (1 of 7 files). Show all
Unified · Split
| @@ -68,6 +68,9 @@ · 67 unmodified lines | |||
| 68 | #include <linux/bpf.h> | 68 | #include <linux/bpf.h> |
| 69 | #include <linux/mount.h> | 69 | #include <linux/mount.h> |
| 70 | #include <linux/userfaultfd_k.h> | 70 | #include <linux/userfaultfd_k.h> |
| 71 | #include <linux/coredump.h> | ||
| 72 | #include <linux/latencytop.h> | ||
| 73 | #include <linux/pid.h> | ||
| 71 | 74 | ||
| 72 | #include "../lib/kstrtox.h" | 75 | #include "../lib/kstrtox.h" |
| 73 | 76 | ||
| @@ -103,22 +106,6 @@ · 29 unmodified lines | |||
| 103 | 106 | ||
| 104 | #if defined(CONFIG_SYSCTL) | 107 | #if defined(CONFIG_SYSCTL) |
| 105 | 108 | ||
| 106 | /* External variables not in a header file. */ | ||
| 107 | extern int suid_dumpable; | ||
| 108 | #ifdef CONFIG_COREDUMP | ||
| 109 | extern int core_uses_pid; | ||
| 110 | extern char core_pattern[]; | ||
| 111 | extern unsigned int core_pipe_limit; | ||
| 112 | #endif | ||
| 113 | extern int pid_max; | ||
| 114 | extern int pid_max_min, pid_max_max; | ||
| 115 | extern int percpu_pagelist_fraction; | ||
| 116 | extern int latencytop_enabled; | ||
| 117 | extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max; | ||
| 118 | #ifndef CONFIG_MMU | ||
| 119 | extern int sysctl_nr_trim_pages; | ||
| 120 | #endif | ||
| 121 | |||
| 122 | /* Constants used for minimum and maximum */ | 109 | /* Constants used for minimum and maximum */ |
| 123 | #ifdef CONFIG_LOCKUP_DETECTOR | 110 | #ifdef CONFIG_LOCKUP_DETECTOR |
| 124 | static int sixty = 60; | 111 | static int sixty = 60; |
| @@ -160,24 +147,6 @@ static unsigned long hung_task_timeout_max = (LONG_MAX/HZ); · 35 unmodified lines | |||
| 160 | #ifdef CONFIG_INOTIFY_USER | 147 | #ifdef CONFIG_INOTIFY_USER |
| 161 | #include <linux/inotify.h> | 148 | #include <linux/inotify.h> |
| 162 | #endif | 149 | #endif |
| 163 | #ifdef CONFIG_SPARC | ||
| 164 | #endif | ||
| 165 | |||
| 166 | #ifdef CONFIG_PARISC | ||
| 167 | extern int pwrsw_enabled; | ||
| 168 | #endif | ||
| 169 | |||
| 170 | #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW | ||
| 171 | extern int unaligned_enabled; | ||
| 172 | #endif | ||
| 173 | |||
| 174 | #ifdef CONFIG_IA64 | ||
| 175 | extern int unaligned_dump_stack; | ||
| 176 | #endif | ||
| 177 | |||
| 178 | #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN | ||
| 179 | extern int no_unaligned_warning; | ||
| 180 | #endif | ||
| 181 | 150 | ||
| 182 | #ifdef CONFIG_PROC_SYSCTL | 151 | #ifdef CONFIG_PROC_SYSCTL |
| 183 | 152 | ||
| @@ -243,14 +212,6 @@ static struct ctl_table vm_table[]; · 59 unmodified lines | |||
| 243 | static struct ctl_table fs_table[]; | 212 | static struct ctl_table fs_table[]; |
| 244 | static struct ctl_table debug_table[]; | 213 | static struct ctl_table debug_table[]; |
| 245 | static struct ctl_table dev_table[]; | 214 | static struct ctl_table dev_table[]; |
| 246 | extern struct ctl_table random_table[]; | ||
| 247 | #ifdef CONFIG_EPOLL | ||
| 248 | extern struct ctl_table epoll_table[]; | ||
| 249 | #endif | ||
| 250 | |||
| 251 | #ifdef CONFIG_FW_LOADER_USER_HELPER | ||
| 252 | extern struct ctl_table firmware_config_table[]; | ||
| 253 | #endif | ||
| 254 | 215 | ||
| 255 | #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \ | 216 | #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \ |
| 256 | defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) | 217 | defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) |