linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 00/11] CONFIG_KMOD removal
@ 2008-07-08 17:00 Johannes Berg
  2008-07-08 17:00 ` [RFC 01/11] make CONFIG_KMOD invisible Johannes Berg
                   ` (11 more replies)
  0 siblings, 12 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

Some place with some code or conditional I just converted to use
CONFIG_MODULES, other places can invoke request_module unconditionally
because it compiles out when the kernel is not modular, and one place
(so far) converted to try_then_request_module.

Comments appreciated.

johannes


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 01/11] make CONFIG_KMOD invisible
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 17:00 ` [RFC 02/11] remove CONFIG_KMOD from core kernel code Johannes Berg
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-invisible.patch --]
[-- Type: text/plain, Size: 1045 bytes --]

... as preparation for removing it completely, make it an
invisible bool defaulting to yes.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 init/Kconfig |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

--- everything.orig/init/Kconfig	2008-07-08 13:42:10.000000000 +0200
+++ everything/init/Kconfig	2008-07-08 16:30:31.000000000 +0200
@@ -893,16 +893,8 @@ config MODULE_SRCVERSION_ALL
 	  will be created for all modules.  If unsure, say N.
 
 config KMOD
-	bool "Automatic kernel module loading"
+	def_bool y
 	depends on MODULES
-	help
-	  Normally when you have selected some parts of the kernel to
-	  be created as kernel modules, you must load them (using the
-	  "modprobe" command) before you can use them. If you say Y
-	  here, some parts of the kernel will be able to load modules
-	  automatically: when a part of the kernel needs a module, it
-	  runs modprobe with the appropriate arguments, thereby
-	  loading the module if it is available.  If unsure, say Y.
 
 config STOP_MACHINE
 	bool

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 02/11] remove CONFIG_KMOD from core kernel code
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
  2008-07-08 17:00 ` [RFC 01/11] make CONFIG_KMOD invisible Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 17:00 ` [RFC 03/11] rework try_then_request_module to do less in non-modular kernels Johannes Berg
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-remove-core.patch --]
[-- Type: text/plain, Size: 2007 bytes --]

Always compile request_module when the kernel allows modules.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 include/linux/kmod.h |    2 +-
 kernel/exec_domain.c |    2 +-
 kernel/kmod.c        |    2 +-
 kernel/sysctl.c      |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

--- everything.orig/include/linux/kmod.h	2008-07-08 17:32:06.000000000 +0200
+++ everything/include/linux/kmod.h	2008-07-08 17:34:37.000000000 +0200
@@ -25,7 +25,7 @@
 
 #define KMOD_PATH_LEN 256
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
 extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
--- everything.orig/kernel/exec_domain.c	2008-07-08 17:32:06.000000000 +0200
+++ everything/kernel/exec_domain.c	2008-07-08 17:34:37.000000000 +0200
@@ -65,7 +65,7 @@ lookup_exec_domain(u_long personality)
 				goto out;
 	}
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	read_unlock(&exec_domains_lock);
 	request_module("personality-%ld", pers);
 	read_lock(&exec_domains_lock);
--- everything.orig/kernel/kmod.c	2008-07-08 17:32:06.000000000 +0200
+++ everything/kernel/kmod.c	2008-07-08 17:34:37.000000000 +0200
@@ -42,7 +42,7 @@ extern int max_threads;
 
 static struct workqueue_struct *khelper_wq;
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 
 /*
 	modprobe_path is set via /proc/sys.
--- everything.orig/kernel/sysctl.c	2008-07-08 17:32:06.000000000 +0200
+++ everything/kernel/sysctl.c	2008-07-08 17:34:37.000000000 +0200
@@ -106,7 +106,7 @@ static int min_percpu_pagelist_fract = 8
 
 static int ngroups_max = NGROUPS_MAX;
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 extern char modprobe_path[];
 #endif
 #ifdef CONFIG_CHR_DEV_SG
@@ -455,7 +455,7 @@ static struct ctl_table kern_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &proc_dointvec,
 	},
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	{
 		.ctl_name	= KERN_MODPROBE,
 		.procname	= "modprobe",

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 03/11] rework try_then_request_module to do less in non-modular kernels
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
  2008-07-08 17:00 ` [RFC 01/11] make CONFIG_KMOD invisible Johannes Berg
  2008-07-08 17:00 ` [RFC 02/11] remove CONFIG_KMOD from core kernel code Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 17:00 ` [RFC 04/11] remove CONFIG_KMOD from drivers Johannes Berg
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-try-then-rework.patch --]
[-- Type: text/plain, Size: 954 bytes --]

This reworks try_then_request_module to only invoke the "lookup"
function "x" once when the kernel is not modular.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 include/linux/kmod.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- everything.orig/include/linux/kmod.h	2008-07-08 18:46:21.000000000 +0200
+++ everything/include/linux/kmod.h	2008-07-08 18:48:34.000000000 +0200
@@ -29,11 +29,12 @@
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
 extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2)));
+#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
 #else
 static inline int request_module(const char * name, ...) { return -ENOSYS; }
+#define try_then_request_module(x, mod...) (x)
 #endif
 
-#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
 
 struct key;
 struct file;

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 04/11] remove CONFIG_KMOD from drivers
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (2 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 03/11] rework try_then_request_module to do less in non-modular kernels Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 18:30   ` Adrian Bunk
  2008-07-08 17:00 ` [RFC 05/11] remove CONFIG_KMOD from sparc64 Johannes Berg
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rusty Russell, Christoph Hellwig, video4linux-list,
	David Woodhouse, linux-ppp, dm-devel

[-- Attachment #1: config-kmod-remove-drivers.patch --]
[-- Type: text/plain, Size: 8615 bytes --]

Straight forward conversions to CONFIG_MODULE; many drivers
include <linux/kmod.h> conditionally and then don't have any
other conditional code so remove it from those.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: video4linux-list@redhat.com
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-ppp@vger.kernel.org
Cc: dm-devel@redhat.com
---
 drivers/md/md.c                                 |    7 +------
 drivers/media/video/cpia.c                      |    4 ----
 drivers/media/video/usbvision/usbvision-core.c  |    4 ----
 drivers/media/video/usbvision/usbvision-video.c |    4 ----
 drivers/media/video/v4l1-compat.c               |    4 ----
 drivers/media/video/v4l2-common.c               |    4 ----
 drivers/media/video/vino.c                      |    5 +----
 drivers/media/video/w9968cf.c                   |    4 ++--
 drivers/mtd/mtdpart.c                           |    2 --
 drivers/net/irda/sir_dongle.c                   |    2 --
 drivers/net/ppp_generic.c                       |   10 +++-------
 drivers/net/pppox.c                             |    9 ++-------
 drivers/video/fbmem.c                           |   17 ++---------------
 13 files changed, 11 insertions(+), 65 deletions(-)

--- everything.orig/drivers/md/md.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/md/md.c	2008-07-08 18:49:10.000000000 +0200
@@ -44,14 +44,9 @@
 #include <linux/mutex.h>
 #include <linux/ctype.h>
 #include <linux/freezer.h>
-
 #include <linux/init.h>
-
 #include <linux/file.h>
-
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 
 #include <asm/unaligned.h>
 
@@ -3410,7 +3405,7 @@ static int do_md_run(mddev_t * mddev)
 		}
 	}
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (mddev->level != LEVEL_NONE)
 		request_module("md-level-%d", mddev->level);
 	else if (mddev->clevel[0])
--- everything.orig/drivers/media/video/cpia.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/cpia.c	2008-07-08 18:49:11.000000000 +0200
@@ -39,10 +39,6 @@
 #include <asm/io.h>
 #include <linux/mutex.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 #include "cpia.h"
 
 static int video_nr = -1;
--- everything.orig/drivers/media/video/usbvision/usbvision-core.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/usbvision/usbvision-core.c	2008-07-08 18:49:11.000000000 +0200
@@ -47,10 +47,6 @@
 
 #include <linux/workqueue.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 #include "usbvision.h"
 
 static unsigned int core_debug;
--- everything.orig/drivers/media/video/usbvision/usbvision-video.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/usbvision/usbvision-video.c	2008-07-08 18:49:11.000000000 +0200
@@ -70,10 +70,6 @@
 
 #include <linux/workqueue.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 #include "usbvision.h"
 #include "usbvision-cards.h"
 
--- everything.orig/drivers/media/video/v4l1-compat.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/v4l1-compat.c	2008-07-08 18:49:11.000000000 +0200
@@ -35,10 +35,6 @@
 #include <asm/system.h>
 #include <asm/pgtable.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 static unsigned int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "enable debug messages");
--- everything.orig/drivers/media/video/v4l2-common.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/v4l2-common.c	2008-07-08 18:49:11.000000000 +0200
@@ -60,10 +60,6 @@
 #include <media/v4l2-common.h>
 #include <media/v4l2-chip-ident.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 #include <linux/videodev.h>
 
 MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr");
--- everything.orig/drivers/media/video/vino.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/vino.c	2008-07-08 18:49:11.000000000 +0200
@@ -30,10 +30,7 @@
 #include <linux/mm.h>
 #include <linux/time.h>
 #include <linux/version.h>
-
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 
 #include <linux/i2c.h>
 #include <linux/i2c-algo-sgi.h>
@@ -4641,7 +4638,7 @@ static int __init vino_module_init(void)
 	}
 	vino_init_stage++;
 
-#if defined(CONFIG_KMOD) && defined(MODULE)
+#ifdef MODULE
 	request_module("saa7191");
 	request_module("indycam");
 #endif
--- everything.orig/drivers/media/video/w9968cf.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/media/video/w9968cf.c	2008-07-08 18:49:11.000000000 +0200
@@ -110,7 +110,7 @@ static int specific_debug = W9968CF_SPEC
 
 static unsigned int param_nv[24]; /* number of values per parameter */
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 module_param(ovmod_load, bool, 0644);
 #endif
 module_param(simcams, ushort, 0644);
@@ -143,7 +143,7 @@ module_param(debug, ushort, 0644);
 module_param(specific_debug, bool, 0644);
 #endif
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 MODULE_PARM_DESC(ovmod_load,
 		 "\n<0|1> Automatic 'ovcamchip' module loading."
 		 "\n0 disabled, 1 enabled."
--- everything.orig/drivers/mtd/mtdpart.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/mtd/mtdpart.c	2008-07-08 18:49:11.000000000 +0200
@@ -555,10 +555,8 @@ int parse_mtd_partitions(struct mtd_info
 
 	for ( ; ret <= 0 && *types; types++) {
 		parser = get_partition_parser(*types);
-#ifdef CONFIG_KMOD
 		if (!parser && !request_module("%s", *types))
 				parser = get_partition_parser(*types);
-#endif
 		if (!parser) {
 			printk(KERN_NOTICE "%s partition parsing not available\n",
 			       *types);
--- everything.orig/drivers/net/irda/sir_dongle.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/net/irda/sir_dongle.c	2008-07-08 18:49:11.000000000 +0200
@@ -67,9 +67,7 @@ int sirdev_get_dongle(struct sir_dev *de
 	const struct dongle_driver *drv = NULL;
 	int err = -EINVAL;
 
-#ifdef CONFIG_KMOD
 	request_module("irda-dongle-%d", type);
-#endif
 
 	if (dev->dongle_drv != NULL)
 		return -EBUSY;
--- everything.orig/drivers/net/ppp_generic.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/net/ppp_generic.c	2008-07-08 18:54:36.000000000 +0200
@@ -2113,13 +2113,9 @@ ppp_set_compress(struct ppp *ppp, unsign
 	    || ccp_option[1] < 2 || ccp_option[1] > data.length)
 		goto out;
 
-	cp = find_compressor(ccp_option[0]);
-#ifdef CONFIG_KMOD
-	if (!cp) {
-		request_module("ppp-compress-%d", ccp_option[0]);
-		cp = find_compressor(ccp_option[0]);
-	}
-#endif /* CONFIG_KMOD */
+	cp = try_then_request_module(
+		find_compressor(ccp_option[0]),
+		"ppp-compress-%d", ccp_option[0]);
 	if (!cp)
 		goto out;
 
--- everything.orig/drivers/net/pppox.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/net/pppox.c	2008-07-08 18:49:11.000000000 +0200
@@ -115,13 +115,8 @@ static int pppox_create(struct net *net,
 		goto out;
 
 	rc = -EPROTONOSUPPORT;
-#ifdef CONFIG_KMOD
-	if (!pppox_protos[protocol]) {
-		char buffer[32];
-		sprintf(buffer, "pppox-proto-%d", protocol);
-		request_module(buffer);
-	}
-#endif
+	if (!pppox_protos[protocol])
+		request_module("pppox-proto-%d", protocol);
 	if (!pppox_protos[protocol] ||
 	    !try_module_get(pppox_protos[protocol]->owner))
 		goto out;
--- everything.orig/drivers/video/fbmem.c	2008-07-08 18:46:21.000000000 +0200
+++ everything/drivers/video/fbmem.c	2008-07-08 18:49:11.000000000 +0200
@@ -28,9 +28,7 @@
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/console.h>
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 #include <linux/err.h>
 #include <linux/device.h>
 #include <linux/efi.h>
@@ -837,13 +835,6 @@ fb_write(struct file *file, const char _
 	return (cnt) ? cnt : err;
 }
 
-#ifdef CONFIG_KMOD
-static void try_to_load(int fb)
-{
-	request_module("fb%d", fb);
-}
-#endif /* CONFIG_KMOD */
-
 int
 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
 {
@@ -1086,10 +1077,8 @@ fb_ioctl(struct inode *inode, struct fil
 		    return -EINVAL;
 		if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
 		    return -EINVAL;
-#ifdef CONFIG_KMOD
 		if (!registered_fb[con2fb.framebuffer])
-		    try_to_load(con2fb.framebuffer);
-#endif /* CONFIG_KMOD */
+		    request_module("fb%d", con2fb.framebuffer);
 		if (!registered_fb[con2fb.framebuffer])
 		    return -EINVAL;
 		event.info = info;
@@ -1326,10 +1315,8 @@ fb_open(struct inode *inode, struct file
 
 	if (fbidx >= FB_MAX)
 		return -ENODEV;
-#ifdef CONFIG_KMOD
 	if (!(info = registered_fb[fbidx]))
-		try_to_load(fbidx);
-#endif /* CONFIG_KMOD */
+		request_module("fb%d", fbidx);
 	if (!(info = registered_fb[fbidx]))
 		return -ENODEV;
 	if (!try_module_get(info->fbops->owner))

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 05/11] remove CONFIG_KMOD from sparc64
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (3 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 04/11] remove CONFIG_KMOD from drivers Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 17:00 ` [RFC 06/11] remove CONFIG_KMOD from fs Johannes Berg
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig, David S. Miller

[-- Attachment #1: config-kmod-remove-sparc64.patch --]
[-- Type: text/plain, Size: 1464 bytes --]

One place is just a comment, the other a conditional, unused
inclusion of linux/kmod.h.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David S. Miller <davem@davemloft.net>
---
 arch/sparc64/kernel/process.c |    6 +++---
 arch/sparc64/kernel/traps.c   |    3 ---
 2 files changed, 3 insertions(+), 6 deletions(-)

--- everything.orig/arch/sparc64/kernel/traps.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/arch/sparc64/kernel/traps.c	2008-07-08 18:56:57.000000000 +0200
@@ -37,9 +37,6 @@
 #include <asm/processor.h>
 #include <asm/timer.h>
 #include <asm/head.h>
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
 #include <asm/prom.h>
 
 #include "entry.h"
--- everything.orig/arch/sparc64/kernel/process.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/arch/sparc64/kernel/process.c	2008-07-08 18:56:57.000000000 +0200
@@ -691,9 +691,9 @@ int copy_thread(int nr, unsigned long cl
 		  ((unsigned long) child_sf) - STACK_BIAS;
 
 		/* Special case, if we are spawning a kernel thread from
-		 * a userspace task (via KMOD, NFS, or similar) we must
-		 * disable performance counters in the child because the
-		 * address space and protection realm are changing.
+		 * a userspace task (usermode helper, NFS or similar), we
+		 * must disable performance counters in the child because
+		 * the address space and protection realm are changing.
 		 */
 		if (t->flags & _TIF_PERFCTR) {
 			t->user_cntd0 = t->user_cntd1 = NULL;

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 06/11] remove CONFIG_KMOD from fs
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (4 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 05/11] remove CONFIG_KMOD from sparc64 Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 19:57   ` Adrian Bunk
  2008-07-08 17:00 ` [RFC 07/11] remove CONFIG_KMOD from sound Johannes Berg
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-remove-fs.patch --]
[-- Type: text/plain, Size: 2283 bytes --]

Just always compile the code when the kernel is modular.
load_nls could be converted to try_then_request_module
but would lose the printk in that case.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 fs/char_dev.c     |    3 ---
 fs/exec.c         |    9 +++------
 fs/nls/nls_base.c |    6 +-----
 3 files changed, 4 insertions(+), 14 deletions(-)

--- everything.orig/fs/char_dev.c	2008-07-08 18:32:40.000000000 +0200
+++ everything/fs/char_dev.c	2008-07-08 18:33:54.000000000 +0200
@@ -22,9 +22,6 @@
 #include <linux/mutex.h>
 #include <linux/backing-dev.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
 #include "internal.h"
 
 /*
--- everything.orig/fs/exec.c	2008-07-08 18:32:40.000000000 +0200
+++ everything/fs/exec.c	2008-07-08 18:33:54.000000000 +0200
@@ -51,15 +51,12 @@
 #include <linux/tsacct_kern.h>
 #include <linux/cn_proc.h>
 #include <linux/audit.h>
+#include <linux/kmod.h>
 
 #include <asm/uaccess.h>
 #include <asm/mmu_context.h>
 #include <asm/tlb.h>
 
-#ifdef CONFIG_KMOD
-#include <linux/kmod.h>
-#endif
-
 #ifdef __alpha__
 /* for /sbin/loader handling in search_binary_handler() */
 #include <linux/a.out.h>
@@ -1239,8 +1236,8 @@ int search_binary_handler(struct linux_b
 		read_unlock(&binfmt_lock);
 		if (retval != -ENOEXEC || bprm->mm == NULL) {
 			break;
-#ifdef CONFIG_KMOD
-		}else{
+#ifdef CONFIG_MODULES
+		} else {
 #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e))
 			if (printable(bprm->buf[0]) &&
 			    printable(bprm->buf[1]) &&
--- everything.orig/fs/nls/nls_base.c	2008-07-08 18:32:40.000000000 +0200
+++ everything/fs/nls/nls_base.c	2008-07-08 18:34:44.000000000 +0200
@@ -13,9 +13,7 @@
 #include <linux/nls.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#ifdef CONFIG_KMOD
 #include <linux/kmod.h>
-#endif
 #include <linux/spinlock.h>
 
 static struct nls_table default_table;
@@ -216,15 +214,13 @@ static struct nls_table *find_nls(char *
 struct nls_table *load_nls(char *charset)
 {
 	struct nls_table *nls;
-#ifdef CONFIG_KMOD
 	int ret;
-#endif
 
 	nls = find_nls(charset);
 	if (nls)
 		return nls;
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	ret = request_module("nls_%s", charset);
 	if (ret != 0) {
 		printk("Unable to load NLS charset %s\n", charset);

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 07/11] remove CONFIG_KMOD from sound
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (5 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 06/11] remove CONFIG_KMOD from fs Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 18:30   ` Adrian Bunk
  2008-07-08 17:00 ` [RFC 08/11] remove CONFIG_KMOD from net Johannes Berg
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig, Takashi Iwai

[-- Attachment #1: config-kmod-remove-sound.patch --]
[-- Type: text/plain, Size: 5114 bytes --]

A bunch of things in alsa depend on CONFIG_KMOD,
use CONFIG_MODULES instead where the dependency
is needed at all.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Takashi Iwai <tiwai@suse.de>
---
 include/sound/seq_kernel.h     |    2 +-
 sound/core/seq/seq_clientmgr.c |    2 +-
 sound/core/seq/seq_device.c    |    6 +++---
 sound/core/sound.c             |    8 ++++----
 sound/core/timer.c             |    6 +++---
 sound/ppc/daca.c               |    2 --
 sound/ppc/tumbler.c            |    2 --
 7 files changed, 12 insertions(+), 16 deletions(-)

--- everything.orig/include/sound/seq_kernel.h	2008-07-08 18:54:04.000000000 +0200
+++ everything/include/sound/seq_kernel.h	2008-07-08 18:57:40.000000000 +0200
@@ -105,7 +105,7 @@ int snd_seq_event_port_attach(int client
 			      int cap, int type, int midi_channels, int midi_voices, char *portname);
 int snd_seq_event_port_detach(int client, int port);
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 void snd_seq_autoload_lock(void);
 void snd_seq_autoload_unlock(void);
 #else
--- everything.orig/sound/core/seq/seq_clientmgr.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/sound/core/seq/seq_clientmgr.c	2008-07-08 18:57:40.000000000 +0200
@@ -148,7 +148,7 @@ struct snd_seq_client *snd_seq_client_us
 		return NULL;
 	}
 	spin_unlock_irqrestore(&clients_lock, flags);
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (!in_interrupt()) {
 		static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS];
 		static char card_requested[SNDRV_CARDS];
--- everything.orig/sound/core/seq/seq_device.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/sound/core/seq/seq_device.c	2008-07-08 18:57:40.000000000 +0200
@@ -124,7 +124,7 @@ static void snd_seq_device_info(struct s
  * load all registered drivers (called from seq_clientmgr.c)
  */
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 /* avoid auto-loading during module_init() */
 static int snd_seq_in_init;
 void snd_seq_autoload_lock(void)
@@ -140,7 +140,7 @@ void snd_seq_autoload_unlock(void)
 
 void snd_seq_device_load_drivers(void)
 {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	struct ops_list *ops;
 
 	/* Calling request_module during module_init()
@@ -566,7 +566,7 @@ EXPORT_SYMBOL(snd_seq_device_load_driver
 EXPORT_SYMBOL(snd_seq_device_new);
 EXPORT_SYMBOL(snd_seq_device_register_driver);
 EXPORT_SYMBOL(snd_seq_device_unregister_driver);
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 EXPORT_SYMBOL(snd_seq_autoload_lock);
 EXPORT_SYMBOL(snd_seq_autoload_unlock);
 #endif
--- everything.orig/sound/core/sound.c	2008-07-08 18:54:04.000000000 +0200
+++ everything/sound/core/sound.c	2008-07-08 18:57:40.000000000 +0200
@@ -60,14 +60,14 @@ EXPORT_SYMBOL(snd_ecards_limit);
 static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
 static DEFINE_MUTEX(sound_mutex);
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 
 /**
  * snd_request_card - try to load the card module
  * @card: the card number
  *
  * Tries to load the module "snd-card-X" for the given card number
- * via KMOD.  Returns immediately if already loaded.
+ * via request_module.  Returns immediately if already loaded.
  */
 void snd_request_card(int card)
 {
@@ -92,7 +92,7 @@ static void snd_request_other(int minor)
 	request_module(str);
 }
 
-#endif				/* request_module support */
+#endif	/* modular kernel */
 
 /**
  * snd_lookup_minor_data - get user data of a registered device
@@ -132,7 +132,7 @@ static int snd_open(struct inode *inode,
 		return -ENODEV;
 	mptr = snd_minors[minor];
 	if (mptr == NULL) {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 		int dev = SNDRV_MINOR_DEVICE(minor);
 		if (dev == SNDRV_MINOR_CONTROL) {
 			/* /dev/aloadC? */
--- everything.orig/sound/core/timer.c	2008-07-08 18:54:04.000000000 +0200
+++ everything/sound/core/timer.c	2008-07-08 18:57:40.000000000 +0200
@@ -146,7 +146,7 @@ static struct snd_timer *snd_timer_find(
 	return NULL;
 }
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 
 static void snd_timer_request(struct snd_timer_id *tid)
 {
@@ -259,8 +259,8 @@ int snd_timer_open(struct snd_timer_inst
 	/* open a master instance */
 	mutex_lock(&register_mutex);
 	timer = snd_timer_find(tid);
-#ifdef CONFIG_KMOD
-	if (timer == NULL) {
+#ifdef CONFIG_MODULES
+	if (!timer) {
 		mutex_unlock(&register_mutex);
 		snd_timer_request(tid);
 		mutex_lock(&register_mutex);
--- everything.orig/sound/ppc/daca.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/sound/ppc/daca.c	2008-07-08 18:57:40.000000000 +0200
@@ -249,9 +249,7 @@ int __init snd_pmac_daca_init(struct snd
 	int i, err;
 	struct pmac_daca *mix;
 
-#ifdef CONFIG_KMOD
 	request_module("i2c-powermac");
-#endif /* CONFIG_KMOD */
 
 	mix = kzalloc(sizeof(*mix), GFP_KERNEL);
 	if (! mix)
--- everything.orig/sound/ppc/tumbler.c	2008-07-08 18:54:05.000000000 +0200
+++ everything/sound/ppc/tumbler.c	2008-07-08 18:57:40.000000000 +0200
@@ -1350,9 +1350,7 @@ int __init snd_pmac_tumbler_init(struct 
 	struct device_node *tas_node, *np;
 	char *chipname;
 
-#ifdef CONFIG_KMOD
 	request_module("i2c-powermac");
-#endif /* CONFIG_KMOD */
 
 	mix = kzalloc(sizeof(*mix), GFP_KERNEL);
 	if (! mix)

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 08/11] remove CONFIG_KMOD from net
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (6 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 07/11] remove CONFIG_KMOD from sound Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 18:30   ` Adrian Bunk
  2008-07-08 17:00 ` [RFC 09/11] remove CONFIG_KMOD from lib Johannes Berg
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig, netdev

[-- Attachment #1: config-kmod-remove-net.patch --]
[-- Type: text/plain, Size: 10532 bytes --]

Some code here depends on CONFIG_KMOD to not try to load
protocol modules or similar, replace by CONFIG_MODULES
where more than just request_module depends on CONFIG_KMOD
and and also use try_then_request_module in ebtables.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: netdev@vger.kernel.org
---
 include/linux/netdevice.h       |    5 ++++-
 net/bluetooth/af_bluetooth.c    |    8 +-------
 net/bridge/netfilter/ebtables.c |   15 +++------------
 net/can/af_can.c                |    4 ++--
 net/core/dev.c                  |    2 +-
 net/core/rtnetlink.c            |    4 ++--
 net/dccp/ccid.c                 |    2 +-
 net/decnet/dn_dev.c             |    2 --
 net/ipv4/devinet.c              |    2 --
 net/ipv4/inet_diag.c            |    2 --
 net/ipv4/tcp_cong.c             |    4 ++--
 net/netfilter/nfnetlink.c       |    2 +-
 net/netlink/af_netlink.c        |    2 +-
 net/sched/act_api.c             |    2 +-
 net/sched/cls_api.c             |    2 +-
 net/sched/ematch.c              |    2 +-
 net/sched/sch_api.c             |    2 +-
 net/socket.c                    |    2 +-
 net/sunrpc/auth.c               |    2 --
 19 files changed, 23 insertions(+), 43 deletions(-)

--- everything.orig/net/bluetooth/af_bluetooth.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/bluetooth/af_bluetooth.c	2008-07-08 18:36:06.000000000 +0200
@@ -36,10 +36,7 @@
 #include <linux/init.h>
 #include <linux/poll.h>
 #include <net/sock.h>
-
-#if defined(CONFIG_KMOD)
 #include <linux/kmod.h>
-#endif
 
 #include <net/bluetooth/bluetooth.h>
 
@@ -144,11 +141,8 @@ static int bt_sock_create(struct net *ne
 	if (proto < 0 || proto >= BT_MAX_PROTO)
 		return -EINVAL;
 
-#if defined(CONFIG_KMOD)
-	if (!bt_proto[proto]) {
+	if (!bt_proto[proto])
 		request_module("bt-proto-%d", proto);
-	}
-#endif
 
 	err = -EPROTONOSUPPORT;
 
--- everything.orig/net/bridge/netfilter/ebtables.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/bridge/netfilter/ebtables.c	2008-07-08 18:36:06.000000000 +0200
@@ -288,23 +288,14 @@ find_inlist_lock_noload(struct list_head
 	return NULL;
 }
 
-#ifndef CONFIG_KMOD
-#define find_inlist_lock(h,n,p,e,m) find_inlist_lock_noload((h),(n),(e),(m))
-#else
 static void *
 find_inlist_lock(struct list_head *head, const char *name, const char *prefix,
    int *error, struct mutex *mutex)
 {
-	void *ret;
-
-	ret = find_inlist_lock_noload(head, name, error, mutex);
-	if (!ret) {
-		request_module("%s%s", prefix, name);
-		ret = find_inlist_lock_noload(head, name, error, mutex);
-	}
-	return ret;
+	return try_then_request_module(
+			find_inlist_lock_noload(head, name, error, mutex),
+			"%s%s", prefix, name);
 }
-#endif
 
 static inline struct ebt_table *
 find_table_lock(const char *name, int *error, struct mutex *mutex)
--- everything.orig/net/can/af_can.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/can/af_can.c	2008-07-08 18:36:06.000000000 +0200
@@ -128,8 +128,8 @@ static int can_create(struct net *net, s
 	if (net != &init_net)
 		return -EAFNOSUPPORT;
 
-#ifdef CONFIG_KMOD
-	/* try to load protocol module, when CONFIG_KMOD is defined */
+#ifdef CONFIG_MODULES
+	/* try to load protocol module kernel is modular */
 	if (!proto_tab[protocol]) {
 		err = request_module("can-proto-%d", protocol);
 
--- everything.orig/net/core/dev.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/core/dev.c	2008-07-08 18:36:06.000000000 +0200
@@ -4639,7 +4639,7 @@ EXPORT_SYMBOL(br_fdb_get_hook);
 EXPORT_SYMBOL(br_fdb_put_hook);
 #endif
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 EXPORT_SYMBOL(dev_load);
 #endif
 
--- everything.orig/net/core/rtnetlink.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/core/rtnetlink.c	2008-07-08 18:36:06.000000000 +0200
@@ -1029,7 +1029,7 @@ static int rtnl_newlink(struct sk_buff *
 	struct nlattr *linkinfo[IFLA_INFO_MAX+1];
 	int err;
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 replay:
 #endif
 	err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFLA_MAX, ifla_policy);
@@ -1118,7 +1118,7 @@ replay:
 			return -EOPNOTSUPP;
 
 		if (!ops) {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 			if (kind[0]) {
 				__rtnl_unlock();
 				request_module("rtnl-link-%s", kind);
--- everything.orig/net/dccp/ccid.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/dccp/ccid.c	2008-07-08 18:36:06.000000000 +0200
@@ -154,7 +154,7 @@ struct ccid *ccid_new(unsigned char id, 
 	struct ccid *ccid = NULL;
 
 	ccids_read_lock();
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (ccids[id] == NULL) {
 		/* We only try to load if in process context */
 		ccids_read_unlock();
--- everything.orig/net/decnet/dn_dev.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/decnet/dn_dev.c	2008-07-08 18:36:06.000000000 +0200
@@ -490,9 +490,7 @@ int dn_dev_ioctl(unsigned int cmd, void 
 		return -EFAULT;
 	ifr->ifr_name[IFNAMSIZ-1] = 0;
 
-#ifdef CONFIG_KMOD
 	dev_load(&init_net, ifr->ifr_name);
-#endif
 
 	switch(cmd) {
 		case SIOCGIFADDR:
--- everything.orig/net/ipv4/devinet.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/ipv4/devinet.c	2008-07-08 18:36:06.000000000 +0200
@@ -613,9 +613,7 @@ int devinet_ioctl(struct net *net, unsig
 	if (colon)
 		*colon = 0;
 
-#ifdef CONFIG_KMOD
 	dev_load(net, ifr.ifr_name);
-#endif
 
 	switch (cmd) {
 	case SIOCGIFADDR:	/* Get interface address */
--- everything.orig/net/ipv4/inet_diag.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/ipv4/inet_diag.c	2008-07-08 18:36:06.000000000 +0200
@@ -55,11 +55,9 @@ static DEFINE_MUTEX(inet_diag_table_mute
 
 static const struct inet_diag_handler *inet_diag_lock_handler(int type)
 {
-#ifdef CONFIG_KMOD
 	if (!inet_diag_table[type])
 		request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
 			       NETLINK_INET_DIAG, type);
-#endif
 
 	mutex_lock(&inet_diag_table_mutex);
 	if (!inet_diag_table[type])
--- everything.orig/net/ipv4/tcp_cong.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/ipv4/tcp_cong.c	2008-07-08 18:36:06.000000000 +0200
@@ -115,7 +115,7 @@ int tcp_set_default_congestion_control(c
 
 	spin_lock(&tcp_cong_list_lock);
 	ca = tcp_ca_find(name);
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (!ca && capable(CAP_SYS_MODULE)) {
 		spin_unlock(&tcp_cong_list_lock);
 
@@ -244,7 +244,7 @@ int tcp_set_congestion_control(struct so
 	if (ca == icsk->icsk_ca_ops)
 		goto out;
 
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	/* not found attempt to autoload module */
 	if (!ca && capable(CAP_SYS_MODULE)) {
 		rcu_read_unlock();
--- everything.orig/net/netfilter/nfnetlink.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/netfilter/nfnetlink.c	2008-07-08 18:36:06.000000000 +0200
@@ -134,7 +134,7 @@ static int nfnetlink_rcv_msg(struct sk_b
 	type = nlh->nlmsg_type;
 	ss = nfnetlink_get_subsys(type);
 	if (!ss) {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 		nfnl_unlock();
 		request_module("nfnetlink-subsys-%d", NFNL_SUBSYS_ID(type));
 		nfnl_lock();
--- everything.orig/net/netlink/af_netlink.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/netlink/af_netlink.c	2008-07-08 18:36:06.000000000 +0200
@@ -434,7 +434,7 @@ static int netlink_create(struct net *ne
 		return -EPROTONOSUPPORT;
 
 	netlink_lock_table();
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (!nl_table[protocol].registered) {
 		netlink_unlock_table();
 		request_module("net-pf-%d-proto-%d", PF_NETLINK, protocol);
--- everything.orig/net/sched/act_api.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/sched/act_api.c	2008-07-08 18:36:06.000000000 +0200
@@ -495,7 +495,7 @@ struct tc_action *tcf_action_init_1(stru
 
 	a_o = tc_lookup_action_n(act_name);
 	if (a_o == NULL) {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 		rtnl_unlock();
 		request_module("act_%s", act_name);
 		rtnl_lock();
--- everything.orig/net/sched/cls_api.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/sched/cls_api.c	2008-07-08 18:36:06.000000000 +0200
@@ -223,7 +223,7 @@ replay:
 		err = -ENOENT;
 		tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND]);
 		if (tp_ops == NULL) {
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 			struct nlattr *kind = tca[TCA_KIND];
 			char name[IFNAMSIZ];
 
--- everything.orig/net/sched/ematch.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/sched/ematch.c	2008-07-08 18:36:06.000000000 +0200
@@ -224,7 +224,7 @@ static int tcf_em_validate(struct tcf_pr
 
 		if (em->ops == NULL) {
 			err = -ENOENT;
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 			__rtnl_unlock();
 			request_module("ematch-kind-%u", em_hdr->kind);
 			rtnl_lock();
--- everything.orig/net/sched/sch_api.c	2008-07-08 18:35:54.000000000 +0200
+++ everything/net/sched/sch_api.c	2008-07-08 18:36:06.000000000 +0200
@@ -457,7 +457,7 @@ qdisc_create(struct net_device *dev, u32
 	struct Qdisc_ops *ops;
 
 	ops = qdisc_lookup_ops(kind);
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	if (ops == NULL && kind != NULL) {
 		char name[IFNAMSIZ];
 		if (nla_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) {
--- everything.orig/net/socket.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/socket.c	2008-07-08 18:36:06.000000000 +0200
@@ -1140,7 +1140,7 @@ static int __sock_create(struct net *net
 
 	sock->type = type;
 
-#if defined(CONFIG_KMOD)
+#ifdef CONFIG_MODULES
 	/* Attempt to load a protocol module if the find failed.
 	 *
 	 * 12/09/1996 Marcin: But! this makes REALLY only sense, if the user
--- everything.orig/net/sunrpc/auth.c	2008-07-08 18:35:53.000000000 +0200
+++ everything/net/sunrpc/auth.c	2008-07-08 18:36:06.000000000 +0200
@@ -83,10 +83,8 @@ rpcauth_create(rpc_authflavor_t pseudofl
 	if (flavor >= RPC_AUTH_MAXFLAVOR)
 		goto out;
 
-#ifdef CONFIG_KMOD
 	if ((ops = auth_flavors[flavor]) == NULL)
 		request_module("rpc-auth-%u", flavor);
-#endif
 	spin_lock(&rpc_authflavor_lock);
 	ops = auth_flavors[flavor];
 	if (ops == NULL || !try_module_get(ops->owner)) {
--- everything.orig/include/linux/netdevice.h	2008-07-08 18:35:53.000000000 +0200
+++ everything/include/linux/netdevice.h	2008-07-08 18:36:06.000000000 +0200
@@ -1484,8 +1484,11 @@ extern void		dev_set_promiscuity(struct 
 extern void		dev_set_allmulti(struct net_device *dev, int inc);
 extern void		netdev_state_change(struct net_device *dev);
 extern void		netdev_features_change(struct net_device *dev);
-/* Load a device via the kmod */
+#ifdef CONFIG_MODULES
 extern void		dev_load(struct net *net, const char *name);
+#else
+static inline void	dev_load(struct net *net, const char *name) {};
+#endif
 extern void		dev_mcast_init(void);
 extern int		netdev_max_backlog;
 extern int		weight_p;

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 09/11] remove CONFIG_KMOD from lib
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (7 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 08/11] remove CONFIG_KMOD from net Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 17:00 ` [RFC 10/11] remove mention of CONFIG_KMOD from documentation Johannes Berg
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-remove-lib.patch --]
[-- Type: text/plain, Size: 671 bytes --]

textsearch algorithms can be loaded, make the code depend
on CONFIG_MODULES instead of CONFIG_KMOD.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 lib/textsearch.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- everything.orig/lib/textsearch.c	2008-07-08 18:54:03.000000000 +0200
+++ everything/lib/textsearch.c	2008-07-08 18:59:04.000000000 +0200
@@ -264,7 +264,7 @@ struct ts_config *textsearch_prepare(con
 		return ERR_PTR(-EINVAL);
 
 	ops = lookup_ts_algo(algo);
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
 	/*
 	 * Why not always autoload you may ask. Some users are
 	 * in a situation where requesting a module may deadlock,

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 10/11] remove mention of CONFIG_KMOD from documentation
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (8 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 09/11] remove CONFIG_KMOD from lib Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-08 23:29   ` Randy Dunlap
  2008-07-08 17:00 ` [RFC 11/11] remove CONFIG_KMOD Johannes Berg
  2008-07-09  2:04 ` [RFC 00/11] CONFIG_KMOD removal Rusty Russell
  11 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rusty Russell, Christoph Hellwig, Michael Kerrisk, Randy Dunlap,
	linux-doc

[-- Attachment #1: config-kmod-remove-doc.patch --]
[-- Type: text/plain, Size: 5823 bytes --]

Also includes a few Kconfig files (xtensa, blackfin)

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: linux-doc@vger.kernel.org
---
 Documentation/filesystems/bfs.txt                     |   10 +++++-----
 Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl |    2 +-
 Documentation/telephony/ixj.txt                       |   13 +++----------
 Documentation/video4linux/w9968cf.txt                 |    3 ---
 arch/blackfin/Kconfig                                 |    4 ++--
 arch/xtensa/Kconfig                                   |    4 ++--
 6 files changed, 13 insertions(+), 23 deletions(-)

--- everything.orig/Documentation/filesystems/bfs.txt	2008-07-08 18:54:03.000000000 +0200
+++ everything/Documentation/filesystems/bfs.txt	2008-07-08 18:59:25.000000000 +0200
@@ -26,11 +26,11 @@ You can simplify mounting by just typing
 
 this will allocate the first available loopback device (and load loop.o 
 kernel module if necessary) automatically. If the loopback driver is not
-loaded automatically, make sure that your kernel is compiled with kmod 
-support (CONFIG_KMOD) enabled. Beware that umount will not
-deallocate /dev/loopN device if /etc/mtab file on your system is a
-symbolic link to /proc/mounts. You will need to do it manually using
-"-d" switch of losetup(8). Read losetup(8) manpage for more info.
+loaded automatically, make sure that you have compiled the module and
+that modprobe is functioning. Beware that umount will not deallocate
+/dev/loopN device if /etc/mtab file on your system is a symbolic link to
+/proc/mounts. You will need to do it manually using "-d" switch of
+losetup(8). Read losetup(8) manpage for more info.
 
 To create the BFS image under UnixWare you need to find out first which
 slice contains it. The command prtvtoc(1M) is your friend:
--- everything.orig/Documentation/telephony/ixj.txt	2008-07-08 18:54:03.000000000 +0200
+++ everything/Documentation/telephony/ixj.txt	2008-07-08 18:59:25.000000000 +0200
@@ -305,21 +305,14 @@ driver, like this:
 
 which will result in the needed drivers getting loaded automatically.
 
-   g.  if you are planning on using kerneld to automatically load the 
-module for you, then you need to edit /etc/conf.modules and add the 
+   g.  if you are planning on having the kernel automatically request
+the module for you, then you need to edit /etc/conf.modules and add the
 following lines:
 
 	options ixj dspio=0x340 xio=0x330 ixjdebug=0
 
 If you do this, then when you execute an application that uses the
-module kerneld will load the module for you.  Note that to do this,
-you need to have your kernel set to support kerneld.  You can check
-for this by looking at /usr/src/linux/.config and you should see this:
-
-	# Loadable module support
-	#
-	<snip>
-	CONFIG_KMOD=y
+module the kernel will request that it is loaded.
 
   h.  if you want non-root users to be able to read and write to the 
 ixj devices (this is a good idea!) you should do the following:
--- everything.orig/Documentation/video4linux/w9968cf.txt	2008-07-08 18:54:02.000000000 +0200
+++ everything/Documentation/video4linux/w9968cf.txt	2008-07-08 18:59:25.000000000 +0200
@@ -193,9 +193,6 @@ Description:     Automatic 'ovcamchip' m
 		 loads that module automatically. This action is performed as
 		 once soon as the 'w9968cf' module is loaded into memory.
 Default:         1
-Note:            The kernel must be compiled with the CONFIG_KMOD option
-		 enabled for the 'ovcamchip' module to be loaded and for
-		 this parameter to be present.
 -------------------------------------------------------------------------------
 Name:           simcams
 Type:           int
--- everything.orig/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl	2008-07-08 18:54:03.000000000 +0200
+++ everything/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl	2008-07-08 18:59:25.000000000 +0200
@@ -42,7 +42,7 @@
      <sect1><title>Device Components</title>
 !Esound/core/device.c
      </sect1>
-     <sect1><title>KMOD and Device File Entries</title>
+     <sect1><title>Module requests and Device File Entries</title>
 !Esound/core/sound.c
      </sect1>
      <sect1><title>Memory Management Helpers</title>
--- everything.orig/arch/blackfin/Kconfig	2008-07-08 18:54:02.000000000 +0200
+++ everything/arch/blackfin/Kconfig	2008-07-08 18:59:25.000000000 +0200
@@ -873,8 +873,8 @@ config HOTPLUG
 	  plugged into slots found on all modern laptop computers.  Another
 	  example, used on modern desktops as well as laptops, is USB.
 
-	  Enable HOTPLUG and KMOD, and build a modular kernel.  Get agent
-	  software (at <http://linux-hotplug.sourceforge.net/>) and install it.
+	  Enable HOTPLUG and build a modular kernel.  Get agent software
+	  (from <http://linux-hotplug.sourceforge.net/>) and install it.
 	  Then your kernel will automatically call out to a user mode "policy
 	  agent" (/sbin/hotplug) to load modules and set up software needed
 	  to use devices as you hotplug them.
--- everything.orig/arch/xtensa/Kconfig	2008-07-08 18:54:02.000000000 +0200
+++ everything/arch/xtensa/Kconfig	2008-07-08 18:59:25.000000000 +0200
@@ -194,8 +194,8 @@ config HOTPLUG
 	plugged into slots found on all modern laptop computers.  Another
 	example, used on modern desktops as well as laptops, is USB.
 
-	Enable HOTPLUG and KMOD, and build a modular kernel.  Get agent
-	software (at <http://linux-hotplug.sourceforge.net/>) and install it.
+	Enable HOTPLUG and build a modular kernel.  Get agent software
+	(from <http://linux-hotplug.sourceforge.net/>) and install it.
 	Then your kernel will automatically call out to a user mode "policy
 	agent" (/sbin/hotplug) to load modules and set up software needed
 	to use devices as you hotplug them.

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [RFC 11/11] remove CONFIG_KMOD
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (9 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 10/11] remove mention of CONFIG_KMOD from documentation Johannes Berg
@ 2008-07-08 17:00 ` Johannes Berg
  2008-07-09  2:04 ` [RFC 00/11] CONFIG_KMOD removal Rusty Russell
  11 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell, Christoph Hellwig

[-- Attachment #1: config-kmod-remove.patch --]
[-- Type: text/plain, Size: 581 bytes --]

Now that nothing depends on it any more, remove CONFIG_KMOD.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 init/Kconfig |    4 ----
 1 file changed, 4 deletions(-)

--- everything.orig/init/Kconfig	2008-07-08 17:15:10.000000000 +0200
+++ everything/init/Kconfig	2008-07-08 17:22:17.000000000 +0200
@@ -892,10 +892,6 @@ config MODULE_SRCVERSION_ALL
 	  the version).  With this option, such a "srcversion" field
 	  will be created for all modules.  If unsure, say N.
 
-config KMOD
-	def_bool y
-	depends on MODULES
-
 config STOP_MACHINE
 	bool
 	default y

-- 


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 04/11] remove CONFIG_KMOD from drivers
  2008-07-08 17:00 ` [RFC 04/11] remove CONFIG_KMOD from drivers Johannes Berg
@ 2008-07-08 18:30   ` Adrian Bunk
  0 siblings, 0 replies; 25+ messages in thread
From: Adrian Bunk @ 2008-07-08 18:30 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-kernel, Rusty Russell, Christoph Hellwig, video4linux-list,
	David Woodhouse, linux-ppp, dm-devel

On Tue, Jul 08, 2008 at 07:00:19PM +0200, Johannes Berg wrote:
>...
> --- everything.orig/drivers/md/md.c	2008-07-08 18:46:21.000000000 +0200
> +++ everything/drivers/md/md.c	2008-07-08 18:49:10.000000000 +0200
>...
> @@ -3410,7 +3405,7 @@ static int do_md_run(mddev_t * mddev)
>  		}
>  	}
>  
> -#ifdef CONFIG_KMOD
> +#ifdef CONFIG_MODULES
>  	if (mddev->level != LEVEL_NONE)
>  		request_module("md-level-%d", mddev->level);
>  	else if (mddev->clevel[0])
>...

You can remove the #ifdef

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 07/11] remove CONFIG_KMOD from sound
  2008-07-08 17:00 ` [RFC 07/11] remove CONFIG_KMOD from sound Johannes Berg
@ 2008-07-08 18:30   ` Adrian Bunk
  2008-07-08 18:38     ` Johannes Berg
  0 siblings, 1 reply; 25+ messages in thread
From: Adrian Bunk @ 2008-07-08 18:30 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-kernel, Rusty Russell, Christoph Hellwig, Takashi Iwai

On Tue, Jul 08, 2008 at 07:00:22PM +0200, Johannes Berg wrote:
>...
> --- everything.orig/sound/core/seq/seq_device.c	2008-07-08 18:54:05.000000000 +0200
> +++ everything/sound/core/seq/seq_device.c	2008-07-08 18:57:40.000000000 +0200
>...
> @@ -566,7 +566,7 @@ EXPORT_SYMBOL(snd_seq_device_load_driver
>  EXPORT_SYMBOL(snd_seq_device_new);
>  EXPORT_SYMBOL(snd_seq_device_register_driver);
>  EXPORT_SYMBOL(snd_seq_device_unregister_driver);
> -#ifdef CONFIG_KMOD
> +#ifdef CONFIG_MODULES
>  EXPORT_SYMBOL(snd_seq_autoload_lock);
>  EXPORT_SYMBOL(snd_seq_autoload_unlock);
>  #endif
>...

You can remove the #ifdef  

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 08/11] remove CONFIG_KMOD from net
  2008-07-08 17:00 ` [RFC 08/11] remove CONFIG_KMOD from net Johannes Berg
@ 2008-07-08 18:30   ` Adrian Bunk
  2008-07-08 18:37     ` Johannes Berg
  0 siblings, 1 reply; 25+ messages in thread
From: Adrian Bunk @ 2008-07-08 18:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig, netdev

On Tue, Jul 08, 2008 at 07:00:23PM +0200, Johannes Berg wrote:
>...
> --- everything.orig/net/core/dev.c	2008-07-08 18:35:53.000000000 +0200
> +++ everything/net/core/dev.c	2008-07-08 18:36:06.000000000 +0200
> @@ -4639,7 +4639,7 @@ EXPORT_SYMBOL(br_fdb_get_hook);
>  EXPORT_SYMBOL(br_fdb_put_hook);
>  #endif
>  
> -#ifdef CONFIG_KMOD
> +#ifdef CONFIG_MODULES
>  EXPORT_SYMBOL(dev_load);
>  #endif
>...

You can remove the #ifdef  

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 08/11] remove CONFIG_KMOD from net
  2008-07-08 18:30   ` Adrian Bunk
@ 2008-07-08 18:37     ` Johannes Berg
  2008-07-08 18:40       ` Adrian Bunk
  0 siblings, 1 reply; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 18:37 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig, netdev

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

On Tue, 2008-07-08 at 21:30 +0300, Adrian Bunk wrote:
> On Tue, Jul 08, 2008 at 07:00:23PM +0200, Johannes Berg wrote:
> >...
> > --- everything.orig/net/core/dev.c	2008-07-08 18:35:53.000000000 +0200
> > +++ everything/net/core/dev.c	2008-07-08 18:36:06.000000000 +0200
> > @@ -4639,7 +4639,7 @@ EXPORT_SYMBOL(br_fdb_get_hook);
> >  EXPORT_SYMBOL(br_fdb_put_hook);
> >  #endif
> >  
> > -#ifdef CONFIG_KMOD
> > +#ifdef CONFIG_MODULES
> >  EXPORT_SYMBOL(dev_load);
> >  #endif
> >...
> 
> You can remove the #ifdef  

Eh, no. Not unless I also always compile in dev_load, which as of now
depends on CONFIG_MODULES. In fact, another hunk in this series makes it
a static inline when CONFIG_MODULES=n so that callers don't need to take
care of #ifdef'ing it.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 07/11] remove CONFIG_KMOD from sound
  2008-07-08 18:30   ` Adrian Bunk
@ 2008-07-08 18:38     ` Johannes Berg
  0 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 18:38 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

On Tue, 2008-07-08 at 21:30 +0300, Adrian Bunk wrote:
> On Tue, Jul 08, 2008 at 07:00:22PM +0200, Johannes Berg wrote:
> >...
> > --- everything.orig/sound/core/seq/seq_device.c	2008-07-08 18:54:05.000000000 +0200
> > +++ everything/sound/core/seq/seq_device.c	2008-07-08 18:57:40.000000000 +0200
> >...
> > @@ -566,7 +566,7 @@ EXPORT_SYMBOL(snd_seq_device_load_driver
> >  EXPORT_SYMBOL(snd_seq_device_new);
> >  EXPORT_SYMBOL(snd_seq_device_register_driver);
> >  EXPORT_SYMBOL(snd_seq_device_unregister_driver);
> > -#ifdef CONFIG_KMOD
> > +#ifdef CONFIG_MODULES
> >  EXPORT_SYMBOL(snd_seq_autoload_lock);
> >  EXPORT_SYMBOL(snd_seq_autoload_unlock);
> >  #endif
> >...
> 
> You can remove the #ifdef  

Same here as with dev_load, unless it's actually ok to export static
inlines.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 08/11] remove CONFIG_KMOD from net
  2008-07-08 18:37     ` Johannes Berg
@ 2008-07-08 18:40       ` Adrian Bunk
  2008-07-08 18:42         ` Johannes Berg
  0 siblings, 1 reply; 25+ messages in thread
From: Adrian Bunk @ 2008-07-08 18:40 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig, netdev

On Tue, Jul 08, 2008 at 08:37:00PM +0200, Johannes Berg wrote:
> On Tue, 2008-07-08 at 21:30 +0300, Adrian Bunk wrote:
> > On Tue, Jul 08, 2008 at 07:00:23PM +0200, Johannes Berg wrote:
> > >...
> > > --- everything.orig/net/core/dev.c	2008-07-08 18:35:53.000000000 +0200
> > > +++ everything/net/core/dev.c	2008-07-08 18:36:06.000000000 +0200
> > > @@ -4639,7 +4639,7 @@ EXPORT_SYMBOL(br_fdb_get_hook);
> > >  EXPORT_SYMBOL(br_fdb_put_hook);
> > >  #endif
> > >  
> > > -#ifdef CONFIG_KMOD
> > > +#ifdef CONFIG_MODULES
> > >  EXPORT_SYMBOL(dev_load);
> > >  #endif
> > >...
> > 
> > You can remove the #ifdef  
> 
> Eh, no. Not unless I also always compile in dev_load, which as of now
> depends on CONFIG_MODULES. In fact, another hunk in this series makes it
> a static inline when CONFIG_MODULES=n so that callers don't need to take
> care of #ifdef'ing it.

Look at include/linux/module.h:

...
#ifdef CONFIG_MODULES
...
#define EXPORT_SYMBOL(sym)                                      \
        __EXPORT_SYMBOL(sym, "")
...
#else /* !CONFIG_MODULES... */
#define EXPORT_SYMBOL(sym)
...

> johannes

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 08/11] remove CONFIG_KMOD from net
  2008-07-08 18:40       ` Adrian Bunk
@ 2008-07-08 18:42         ` Johannes Berg
  0 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 18:42 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig, netdev

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]


> > Eh, no. Not unless I also always compile in dev_load, which as of now
> > depends on CONFIG_MODULES. In fact, another hunk in this series makes it
> > a static inline when CONFIG_MODULES=n so that callers don't need to take
> > care of #ifdef'ing it.
> 
> Look at include/linux/module.h:
> 
> ...
> #ifdef CONFIG_MODULES
> ...
> #define EXPORT_SYMBOL(sym)                                      \
>         __EXPORT_SYMBOL(sym, "")
> ...
> #else /* !CONFIG_MODULES... */
> #define EXPORT_SYMBOL(sym)
> ...

Oh, right, I forgot I was dealing with CONFIG_MODULES and treated it
just like another config option, thanks.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 06/11] remove CONFIG_KMOD from fs
  2008-07-08 17:00 ` [RFC 06/11] remove CONFIG_KMOD from fs Johannes Berg
@ 2008-07-08 19:57   ` Adrian Bunk
  2008-07-08 20:09     ` Johannes Berg
  2008-07-08 20:11     ` Johannes Berg
  0 siblings, 2 replies; 25+ messages in thread
From: Adrian Bunk @ 2008-07-08 19:57 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig

On Tue, Jul 08, 2008 at 07:00:21PM +0200, Johannes Berg wrote:
>...
> --- everything.orig/fs/nls/nls_base.c	2008-07-08 18:32:40.000000000 +0200
> +++ everything/fs/nls/nls_base.c	2008-07-08 18:34:44.000000000 +0200
>...
> @@ -216,15 +214,13 @@ static struct nls_table *find_nls(char *
>  struct nls_table *load_nls(char *charset)
>  {
>  	struct nls_table *nls;
> -#ifdef CONFIG_KMOD
>  	int ret;
> -#endif

That gives an "unused variable" gcc warning with CONFIG_MODULES=n.

>  	nls = find_nls(charset);
>  	if (nls)
>  		return nls;
>  
> -#ifdef CONFIG_KMOD
> +#ifdef CONFIG_MODULES
>  	ret = request_module("nls_%s", charset);
>  	if (ret != 0) {
>  		printk("Unable to load NLS charset %s\n", charset);
> 

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 06/11] remove CONFIG_KMOD from fs
  2008-07-08 19:57   ` Adrian Bunk
@ 2008-07-08 20:09     ` Johannes Berg
  2008-07-08 20:11     ` Johannes Berg
  1 sibling, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 20:09 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

On Tue, 2008-07-08 at 22:57 +0300, Adrian Bunk wrote:
> On Tue, Jul 08, 2008 at 07:00:21PM +0200, Johannes Berg wrote:
> >...
> > --- everything.orig/fs/nls/nls_base.c	2008-07-08 18:32:40.000000000 +0200
> > +++ everything/fs/nls/nls_base.c	2008-07-08 18:34:44.000000000 +0200
> >...
> > @@ -216,15 +214,13 @@ static struct nls_table *find_nls(char *
> >  struct nls_table *load_nls(char *charset)
> >  {
> >  	struct nls_table *nls;
> > -#ifdef CONFIG_KMOD
> >  	int ret;
> > -#endif
> 
> That gives an "unused variable" gcc warning with CONFIG_MODULES=n.

Will fix, thanks.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 06/11] remove CONFIG_KMOD from fs
  2008-07-08 19:57   ` Adrian Bunk
  2008-07-08 20:09     ` Johannes Berg
@ 2008-07-08 20:11     ` Johannes Berg
  1 sibling, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-08 20:11 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-kernel, Rusty Russell, Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

On Tue, 2008-07-08 at 22:57 +0300, Adrian Bunk wrote:
> On Tue, Jul 08, 2008 at 07:00:21PM +0200, Johannes Berg wrote:
> >...
> > --- everything.orig/fs/nls/nls_base.c	2008-07-08 18:32:40.000000000 +0200
> > +++ everything/fs/nls/nls_base.c	2008-07-08 18:34:44.000000000 +0200
> >...
> > @@ -216,15 +214,13 @@ static struct nls_table *find_nls(char *
> >  struct nls_table *load_nls(char *charset)
> >  {
> >  	struct nls_table *nls;
> > -#ifdef CONFIG_KMOD
> >  	int ret;
> > -#endif
> 
> That gives an "unused variable" gcc warning with CONFIG_MODULES=n.

Actually, would anyone object to removing the printk and just using
try_then_request_module?

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 10/11] remove mention of CONFIG_KMOD from documentation
  2008-07-08 17:00 ` [RFC 10/11] remove mention of CONFIG_KMOD from documentation Johannes Berg
@ 2008-07-08 23:29   ` Randy Dunlap
  0 siblings, 0 replies; 25+ messages in thread
From: Randy Dunlap @ 2008-07-08 23:29 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-kernel, Rusty Russell, Christoph Hellwig, Michael Kerrisk,
	Randy Dunlap, linux-doc

On Tue, 08 Jul 2008 19:00:25 +0200 Johannes Berg wrote:

> Also includes a few Kconfig files (xtensa, blackfin)
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Cc: Michael Kerrisk <mtk.manpages@gmail.com>
> Cc: Randy Dunlap <rdunlap@xenotime.net>
> Cc: linux-doc@vger.kernel.org

Acked-by: Randy Dunlap <rdunlap@xenotime.net>


> ---
>  Documentation/filesystems/bfs.txt                     |   10 +++++-----
>  Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl |    2 +-
>  Documentation/telephony/ixj.txt                       |   13 +++----------
>  Documentation/video4linux/w9968cf.txt                 |    3 ---
>  arch/blackfin/Kconfig                                 |    4 ++--
>  arch/xtensa/Kconfig                                   |    4 ++--
>  6 files changed, 13 insertions(+), 23 deletions(-)
> 
> --- everything.orig/Documentation/filesystems/bfs.txt	2008-07-08 18:54:03.000000000 +0200
> +++ everything/Documentation/filesystems/bfs.txt	2008-07-08 18:59:25.000000000 +0200
> @@ -26,11 +26,11 @@ You can simplify mounting by just typing
>  
>  this will allocate the first available loopback device (and load loop.o 
>  kernel module if necessary) automatically. If the loopback driver is not
> -loaded automatically, make sure that your kernel is compiled with kmod 
> -support (CONFIG_KMOD) enabled. Beware that umount will not
> -deallocate /dev/loopN device if /etc/mtab file on your system is a
> -symbolic link to /proc/mounts. You will need to do it manually using
> -"-d" switch of losetup(8). Read losetup(8) manpage for more info.
> +loaded automatically, make sure that you have compiled the module and
> +that modprobe is functioning. Beware that umount will not deallocate
> +/dev/loopN device if /etc/mtab file on your system is a symbolic link to
> +/proc/mounts. You will need to do it manually using "-d" switch of
> +losetup(8). Read losetup(8) manpage for more info.
>  
>  To create the BFS image under UnixWare you need to find out first which
>  slice contains it. The command prtvtoc(1M) is your friend:
> --- everything.orig/Documentation/telephony/ixj.txt	2008-07-08 18:54:03.000000000 +0200
> +++ everything/Documentation/telephony/ixj.txt	2008-07-08 18:59:25.000000000 +0200
> @@ -305,21 +305,14 @@ driver, like this:
>  
>  which will result in the needed drivers getting loaded automatically.
>  
> -   g.  if you are planning on using kerneld to automatically load the 
> -module for you, then you need to edit /etc/conf.modules and add the 
> +   g.  if you are planning on having the kernel automatically request
> +the module for you, then you need to edit /etc/conf.modules and add the
>  following lines:
>  
>  	options ixj dspio=0x340 xio=0x330 ixjdebug=0
>  
>  If you do this, then when you execute an application that uses the
> -module kerneld will load the module for you.  Note that to do this,
> -you need to have your kernel set to support kerneld.  You can check
> -for this by looking at /usr/src/linux/.config and you should see this:
> -
> -	# Loadable module support
> -	#
> -	<snip>
> -	CONFIG_KMOD=y
> +module the kernel will request that it is loaded.
>  
>    h.  if you want non-root users to be able to read and write to the 
>  ixj devices (this is a good idea!) you should do the following:
> --- everything.orig/Documentation/video4linux/w9968cf.txt	2008-07-08 18:54:02.000000000 +0200
> +++ everything/Documentation/video4linux/w9968cf.txt	2008-07-08 18:59:25.000000000 +0200
> @@ -193,9 +193,6 @@ Description:     Automatic 'ovcamchip' m
>  		 loads that module automatically. This action is performed as
>  		 once soon as the 'w9968cf' module is loaded into memory.
>  Default:         1
> -Note:            The kernel must be compiled with the CONFIG_KMOD option
> -		 enabled for the 'ovcamchip' module to be loaded and for
> -		 this parameter to be present.
>  -------------------------------------------------------------------------------
>  Name:           simcams
>  Type:           int
> --- everything.orig/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl	2008-07-08 18:54:03.000000000 +0200
> +++ everything/Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl	2008-07-08 18:59:25.000000000 +0200
> @@ -42,7 +42,7 @@
>       <sect1><title>Device Components</title>
>  !Esound/core/device.c
>       </sect1>
> -     <sect1><title>KMOD and Device File Entries</title>
> +     <sect1><title>Module requests and Device File Entries</title>
>  !Esound/core/sound.c
>       </sect1>
>       <sect1><title>Memory Management Helpers</title>
> --- everything.orig/arch/blackfin/Kconfig	2008-07-08 18:54:02.000000000 +0200
> +++ everything/arch/blackfin/Kconfig	2008-07-08 18:59:25.000000000 +0200
> @@ -873,8 +873,8 @@ config HOTPLUG
>  	  plugged into slots found on all modern laptop computers.  Another
>  	  example, used on modern desktops as well as laptops, is USB.
>  
> -	  Enable HOTPLUG and KMOD, and build a modular kernel.  Get agent
> -	  software (at <http://linux-hotplug.sourceforge.net/>) and install it.
> +	  Enable HOTPLUG and build a modular kernel.  Get agent software
> +	  (from <http://linux-hotplug.sourceforge.net/>) and install it.
>  	  Then your kernel will automatically call out to a user mode "policy
>  	  agent" (/sbin/hotplug) to load modules and set up software needed
>  	  to use devices as you hotplug them.
> --- everything.orig/arch/xtensa/Kconfig	2008-07-08 18:54:02.000000000 +0200
> +++ everything/arch/xtensa/Kconfig	2008-07-08 18:59:25.000000000 +0200
> @@ -194,8 +194,8 @@ config HOTPLUG
>  	plugged into slots found on all modern laptop computers.  Another
>  	example, used on modern desktops as well as laptops, is USB.
>  
> -	Enable HOTPLUG and KMOD, and build a modular kernel.  Get agent
> -	software (at <http://linux-hotplug.sourceforge.net/>) and install it.
> +	Enable HOTPLUG and build a modular kernel.  Get agent software
> +	(from <http://linux-hotplug.sourceforge.net/>) and install it.
>  	Then your kernel will automatically call out to a user mode "policy
>  	agent" (/sbin/hotplug) to load modules and set up software needed
>  	to use devices as you hotplug them.
> 
> -- 

---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 00/11] CONFIG_KMOD removal
  2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
                   ` (10 preceding siblings ...)
  2008-07-08 17:00 ` [RFC 11/11] remove CONFIG_KMOD Johannes Berg
@ 2008-07-09  2:04 ` Rusty Russell
  2008-07-09  7:41   ` Johannes Berg
  11 siblings, 1 reply; 25+ messages in thread
From: Rusty Russell @ 2008-07-09  2:04 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-kernel, Christoph Hellwig

On Wednesday 09 July 2008 03:00:15 Johannes Berg wrote:
> Some place with some code or conditional I just converted to use
> CONFIG_MODULES, other places can invoke request_module unconditionally
> because it compiles out when the kernel is not modular, and one place
> (so far) converted to try_then_request_module.

Applied 1, 2, 3, 5, 9, 10 and 11.  The others had comments.

I added a help comment to the KMOD Kconfig, pointing out that it is 
deprecated.

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [RFC 00/11] CONFIG_KMOD removal
  2008-07-09  2:04 ` [RFC 00/11] CONFIG_KMOD removal Rusty Russell
@ 2008-07-09  7:41   ` Johannes Berg
  0 siblings, 0 replies; 25+ messages in thread
From: Johannes Berg @ 2008-07-09  7:41 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 797 bytes --]

On Wed, 2008-07-09 at 12:04 +1000, Rusty Russell wrote:
> On Wednesday 09 July 2008 03:00:15 Johannes Berg wrote:
> > Some place with some code or conditional I just converted to use
> > CONFIG_MODULES, other places can invoke request_module unconditionally
> > because it compiles out when the kernel is not modular, and one place
> > (so far) converted to try_then_request_module.
> 
> Applied 1, 2, 3, 5, 9, 10 and 11.  The others had comments.

What to? I took akpm's advice and rebased them against linux-next, a few
had minor conflicts. Nothing changed _much_, I only addressed the
comments and fixed those small conflicts.

I'll send the updated set.

> I added a help comment to the KMOD Kconfig, pointing out that it is 
> deprecated.

Good point.

Thanks,
johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2008-07-09  7:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-08 17:00 [RFC 00/11] CONFIG_KMOD removal Johannes Berg
2008-07-08 17:00 ` [RFC 01/11] make CONFIG_KMOD invisible Johannes Berg
2008-07-08 17:00 ` [RFC 02/11] remove CONFIG_KMOD from core kernel code Johannes Berg
2008-07-08 17:00 ` [RFC 03/11] rework try_then_request_module to do less in non-modular kernels Johannes Berg
2008-07-08 17:00 ` [RFC 04/11] remove CONFIG_KMOD from drivers Johannes Berg
2008-07-08 18:30   ` Adrian Bunk
2008-07-08 17:00 ` [RFC 05/11] remove CONFIG_KMOD from sparc64 Johannes Berg
2008-07-08 17:00 ` [RFC 06/11] remove CONFIG_KMOD from fs Johannes Berg
2008-07-08 19:57   ` Adrian Bunk
2008-07-08 20:09     ` Johannes Berg
2008-07-08 20:11     ` Johannes Berg
2008-07-08 17:00 ` [RFC 07/11] remove CONFIG_KMOD from sound Johannes Berg
2008-07-08 18:30   ` Adrian Bunk
2008-07-08 18:38     ` Johannes Berg
2008-07-08 17:00 ` [RFC 08/11] remove CONFIG_KMOD from net Johannes Berg
2008-07-08 18:30   ` Adrian Bunk
2008-07-08 18:37     ` Johannes Berg
2008-07-08 18:40       ` Adrian Bunk
2008-07-08 18:42         ` Johannes Berg
2008-07-08 17:00 ` [RFC 09/11] remove CONFIG_KMOD from lib Johannes Berg
2008-07-08 17:00 ` [RFC 10/11] remove mention of CONFIG_KMOD from documentation Johannes Berg
2008-07-08 23:29   ` Randy Dunlap
2008-07-08 17:00 ` [RFC 11/11] remove CONFIG_KMOD Johannes Berg
2008-07-09  2:04 ` [RFC 00/11] CONFIG_KMOD removal Rusty Russell
2008-07-09  7:41   ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).