Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

remove CONFIG_KMOD from fs

Just always compile the code when the kernel is modular.
Convert load_nls to use try_then_request_module to tidy
up the code.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

authored by

Johannes Berg and committed by
Rusty Russell
5f4123be a65e5d78

+4 -29
-3
fs/char_dev.c
··· 22 22 #include <linux/mutex.h> 23 23 #include <linux/backing-dev.h> 24 24 25 - #ifdef CONFIG_KMOD 26 - #include <linux/kmod.h> 27 - #endif 28 25 #include "internal.h" 29 26 30 27 /*
+3 -6
fs/exec.c
··· 50 50 #include <linux/cn_proc.h> 51 51 #include <linux/audit.h> 52 52 #include <linux/tracehook.h> 53 + #include <linux/kmod.h> 53 54 54 55 #include <asm/uaccess.h> 55 56 #include <asm/mmu_context.h> 56 57 #include <asm/tlb.h> 57 - 58 - #ifdef CONFIG_KMOD 59 - #include <linux/kmod.h> 60 - #endif 61 58 62 59 #ifdef __alpha__ 63 60 /* for /sbin/loader handling in search_binary_handler() */ ··· 1244 1247 read_unlock(&binfmt_lock); 1245 1248 if (retval != -ENOEXEC || bprm->mm == NULL) { 1246 1249 break; 1247 - #ifdef CONFIG_KMOD 1248 - }else{ 1250 + #ifdef CONFIG_MODULES 1251 + } else { 1249 1252 #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) 1250 1253 if (printable(bprm->buf[0]) && 1251 1254 printable(bprm->buf[1]) &&
+1 -20
fs/nls/nls_base.c
··· 13 13 #include <linux/nls.h> 14 14 #include <linux/kernel.h> 15 15 #include <linux/errno.h> 16 - #ifdef CONFIG_KMOD 17 16 #include <linux/kmod.h> 18 - #endif 19 17 #include <linux/spinlock.h> 20 18 21 19 static struct nls_table default_table; ··· 213 215 214 216 struct nls_table *load_nls(char *charset) 215 217 { 216 - struct nls_table *nls; 217 - #ifdef CONFIG_KMOD 218 - int ret; 219 - #endif 220 - 221 - nls = find_nls(charset); 222 - if (nls) 223 - return nls; 224 - 225 - #ifdef CONFIG_KMOD 226 - ret = request_module("nls_%s", charset); 227 - if (ret != 0) { 228 - printk("Unable to load NLS charset %s\n", charset); 229 - return NULL; 230 - } 231 - nls = find_nls(charset); 232 - #endif 233 - return nls; 218 + return try_then_request_module(find_nls(charset), "nls_%s", charset); 234 219 } 235 220 236 221 void unload_nls(struct nls_table *nls)