Skip to content

Commit 5f4123b

Browse files
jmbergrustyrussell
authored andcommitted
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>
1 parent a65e5d7 commit 5f4123b

3 files changed

Lines changed: 4 additions & 29 deletions

File tree

‎fs/char_dev.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
#include <linux/mutex.h>
2323
#include <linux/backing-dev.h>
2424

25-
#ifdef CONFIG_KMOD
26-
#include <linux/kmod.h>
27-
#endif
2825
#include "internal.h"
2926

3027
/*

‎fs/exec.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,12 @@
5050
#include <linux/cn_proc.h>
5151
#include <linux/audit.h>
5252
#include <linux/tracehook.h>
53+
#include <linux/kmod.h>
5354

5455
#include <asm/uaccess.h>
5556
#include <asm/mmu_context.h>
5657
#include <asm/tlb.h>
5758

58-
#ifdef CONFIG_KMOD
59-
#include <linux/kmod.h>
60-
#endif
61-
6259
#ifdef __alpha__
6360
/* for /sbin/loader handling in search_binary_handler() */
6461
#include <linux/a.out.h>
@@ -1247,8 +1244,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
12471244
read_unlock(&binfmt_lock);
12481245
if (retval != -ENOEXEC || bprm->mm == NULL) {
12491246
break;
1250-
#ifdef CONFIG_KMOD
1251-
}else{
1247+
#ifdef CONFIG_MODULES
1248+
} else {
12521249
#define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e))
12531250
if (printable(bprm->buf[0]) &&
12541251
printable(bprm->buf[1]) &&

‎fs/nls/nls_base.c‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
#include <linux/nls.h>
1414
#include <linux/kernel.h>
1515
#include <linux/errno.h>
16-
#ifdef CONFIG_KMOD
1716
#include <linux/kmod.h>
18-
#endif
1917
#include <linux/spinlock.h>
2018

2119
static struct nls_table default_table;
@@ -215,24 +213,7 @@ static struct nls_table *find_nls(char *charset)
215213

216214
struct nls_table *load_nls(char *charset)
217215
{
218-
struct nls_table *nls;
219-
#ifdef CONFIG_KMOD
220-
int ret;
221-
#endif
222-
223-
nls = find_nls(charset);
224-
if (nls)
225-
return nls;
226-
227-
#ifdef CONFIG_KMOD
228-
ret = request_module("nls_%s", charset);
229-
if (ret != 0) {
230-
printk("Unable to load NLS charset %s\n", charset);
231-
return NULL;
232-
}
233-
nls = find_nls(charset);
234-
#endif
235-
return nls;
216+
return try_then_request_module(find_nls(charset), "nls_%s", charset);
236217
}
237218

238219
void unload_nls(struct nls_table *nls)

0 commit comments

Comments
 (0)