[PATCH] [MTD] block2mtd.c: Remove unnecessary parsing of empty boot-time argument

Ville Herva vherva at vianova.fi
Thu Jul 13 11:41:10 EDT 2006


Statically compiled block2mtd driver with no boot-time parameter works, but
it does unnecessarily printk

   error: cannot open device ""

since argument parsing is invoked even when no argument is supplied.
This is harmless as no "" device is found, but perhaps worth correcting.

This is an incremental patch against the "Make kernel boot command line
arguments work (try 3)" patch.


From: Ville Herva <vherva at vianova.fi>
Signed-off-by: Ville Herva <vherva at vianova.fi>
Acked-by: Joern Engel <joern at wohnheim.fh-wedel.de>

--- linux-2.6.17.3.NEW3/drivers/mtd/devices/block2mtd.c	2006-07-07 15:05:40.000000000 +0300
+++ linux-2.6.17.3.NEW4/drivers/mtd/devices/block2mtd.c	2006-07-13 18:28:31.000000000 +0300
@@ -507,7 +507,8 @@ static int __init block2mtd_init(void)
 	INFO("version " VERSION);
 
 #ifndef MODULE	
-	ret = block2mtd_setup2(block2mtd_paramline);
+	if (strlen(block2mtd_paramline))
+		ret = block2mtd_setup2(block2mtd_paramline);
 	block2mtd_init_called = 1;
 #endif
 




More information about the linux-mtd mailing list