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.
Unified · Split
| @@ -22,4 +22,8 @@ extern void do_coredump(const kernel_siginfo_t *siginfo); · 21 unmodified lines | ||
| 22 | 22 | static inline void do_coredump(const kernel_siginfo_t *siginfo) {} |
| 23 | 23 | #endif |
| 24 | 24 | |
| 25 | +extern int core_uses_pid; | |
| 26 | +extern char core_pattern[]; | |
| 27 | +extern unsigned int core_pipe_limit; | |
| 28 | + | |
| 25 | 29 | #endif /* _LINUX_COREDUMP_H */ |
| @@ -94,4 +94,6 @@ extern void fd_install(unsigned int fd, struct file *file); · 93 unmodified lines | ||
| 94 | 94 | extern void flush_delayed_fput(void); |
| 95 | 95 | extern void __fput_sync(struct file *); |
| 96 | 96 | |
| 97 | +extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max; | |
| 98 | + | |
| 97 | 99 | #endif /* __LINUX_FILE_H */ |
| @@ -3140,5 +3140,7 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping, · 3139 unmodified lines | ||
| 3140 | 3140 | pgoff_t first_index, pgoff_t nr); |
| 3141 | 3141 | #endif |
| 3142 | 3142 | |
| 3143 | +extern int sysctl_nr_trim_pages; | |
| 3144 | + | |
| 3143 | 3145 | #endif /* __KERNEL__ */ |
| 3144 | 3146 | #endif /* _LINUX_MM_H */ |
| @@ -909,6 +909,7 @@ static inline int is_highmem(struct zone *zone) · 908 unmodified lines | ||
| 909 | 909 | |
| 910 | 910 | /* These two functions are used to setup the per zone pages min values */ |
| 911 | 911 | struct ctl_table; |
| 912 | + | |
| 912 | 913 | int min_free_kbytes_sysctl_handler(struct ctl_table *, int, |
| 913 | 914 | void __user *, size_t *, loff_t *); |
| 914 | 915 | int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, |
| @@ -925,6 +926,7 @@ int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, · 10 unmodified lines | ||
| 925 | 926 | |
| 926 | 927 | extern int numa_zonelist_order_handler(struct ctl_table *, int, |
| 927 | 928 | void __user *, size_t *, loff_t *); |
| 929 | +extern int percpu_pagelist_fraction; | |
| 928 | 930 | extern char numa_zonelist_order[]; |
| 929 | 931 | #define NUMA_ZONELIST_ORDER_LEN 16 |
| 930 | 932 | |
| @@ -108,6 +108,9 @@ extern void transfer_pid(struct task_struct *old, struct task_struct *new, · 107 unmodified lines | ||
| 108 | 108 | struct pid_namespace; |
| 109 | 109 | extern struct pid_namespace init_pid_ns; |
| 110 | 110 | |
| 111 | +extern int pid_max; | |
| 112 | +extern int pid_max_min, pid_max_max; | |
| 113 | + | |
| 111 | 114 | /* |
| 112 | 115 | * look up a PID in the hash table. Must be called with the tasklist_lock |
| 113 | 116 | * or rcu_read_lock() held. |
| @@ -207,7 +207,15 @@ void unregister_sysctl_table(struct ctl_table_header * table); · 206 unmodified lines | ||
| 207 | 207 | |
| 208 | 208 | extern int sysctl_init(void); |
| 209 | 209 | |
| 210 | +extern int pwrsw_enabled; | |
| 211 | +extern int unaligned_enabled; | |
| 212 | +extern int unaligned_dump_stack; | |
| 213 | +extern int no_unaligned_warning; | |
| 214 | + | |
| 210 | 215 | extern struct ctl_table sysctl_mount_point[]; |
| 216 | +extern struct ctl_table random_table[]; | |
| 217 | +extern struct ctl_table firmware_config_table[]; | |
| 218 | +extern struct ctl_table epoll_table[]; | |
| 211 | 219 | |
| 212 | 220 | #else /* CONFIG_SYSCTL */ |
| 213 | 221 | static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table) |
| @@ -68,6 +68,9 @@ · 67 unmodified lines | ||
| 68 | 68 | #include <linux/bpf.h> |
| 69 | 69 | #include <linux/mount.h> |
| 70 | 70 | #include <linux/userfaultfd_k.h> |
| 71 | +#include <linux/coredump.h> | |
| 72 | +#include <linux/latencytop.h> | |
| 73 | +#include <linux/pid.h> | |
| 71 | 74 | |
| 72 | 75 | #include "../lib/kstrtox.h" |
| 73 | 76 | |
| @@ -103,22 +106,6 @@ · 29 unmodified lines | ||
| 103 | 106 | |
| 104 | 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 | 109 | /* Constants used for minimum and maximum */ |
| 123 | 110 | #ifdef CONFIG_LOCKUP_DETECTOR |
| 124 | 111 | static int sixty = 60; |
| @@ -160,24 +147,6 @@ static unsigned long hung_task_timeout_max = (LONG_MAX/HZ); · 35 unmodified lines | ||
| 160 | 147 | #ifdef CONFIG_INOTIFY_USER |
| 161 | 148 | #include <linux/inotify.h> |
| 162 | 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 | 151 | #ifdef CONFIG_PROC_SYSCTL |
| 183 | 152 | |
| @@ -243,14 +212,6 @@ static struct ctl_table vm_table[]; · 59 unmodified lines | ||
| 243 | 212 | static struct ctl_table fs_table[]; |
| 244 | 213 | static struct ctl_table debug_table[]; |
| 245 | 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 | 216 | #if defined(HAVE_ARCH_PICK_MMAP_LAYOUT) || \ |
| 256 | 217 | defined(CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT) |