Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274972
b: refs/heads/master
c: 7406060
h: refs/heads/master
v: v3
  • Loading branch information
Wolfram Sang authored and Artem Bityutskiy committed Oct 30, 2011
1 parent 5c331ad commit 72499c9
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6be55f79a216ccb9f364476b12e5b151a5f6bdb6
refs/heads/master: 7406060e292c389fe6f38bd23493de9b57f2f4fc
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_oobtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#define PRINT_PREF KERN_INFO "mtd_oobtest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -366,6 +366,13 @@ static int __init mtd_oobtest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_pagetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#define PRINT_PREF KERN_INFO "mtd_pagetest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -504,6 +504,13 @@ static int __init mtd_pagetest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/mtd/tests/mtd_readtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define PRINT_PREF KERN_INFO "mtd_readtest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -170,6 +170,12 @@ static int __init mtd_readtest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_speedtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define PRINT_PREF KERN_INFO "mtd_speedtest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -361,6 +361,13 @@ static int __init mtd_speedtest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

if (count)
printk(PRINT_PREF "MTD device: %d count: %d\n", dev, count);
else
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_stresstest.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#define PRINT_PREF KERN_INFO "mtd_stresstest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -250,6 +250,13 @@ static int __init mtd_stresstest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_subpagetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define PRINT_PREF KERN_INFO "mtd_subpagetest: "

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -379,6 +379,13 @@ static int __init mtd_subpagetest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/mtd/tests/mtd_torturetest.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int pgcnt;
module_param(pgcnt, int, S_IRUGO);
MODULE_PARM_DESC(pgcnt, "number of pages per eraseblock to torture (0 => all)");

static int dev;
static int dev = -EINVAL;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

Expand Down Expand Up @@ -213,6 +213,13 @@ static int __init tort_init(void)
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "Warning: this program is trying to wear out your "
"flash, stop it if this is not wanted.\n");

if (dev < 0) {
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n");
return -EINVAL;
}

printk(PRINT_PREF "MTD device: %d\n", dev);
printk(PRINT_PREF "torture %d eraseblocks (%d-%d) of mtd%d\n",
ebcnt, eb, eb + ebcnt - 1, dev);
Expand Down

0 comments on commit 72499c9

Please sign in to comment.