Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242762
b: refs/heads/master
c: fc7fe76
h: refs/heads/master
v: v3
  • Loading branch information
Adrian Hunter authored and David Woodhouse committed Mar 11, 2011
1 parent 4b2fdc5 commit a372be8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: e6da85685b2dec1e69e58366c22d1f883d6da575
refs/heads/master: fc7fe7691c6bbd5f8f51a87e759770975c648410
15 changes: 13 additions & 2 deletions trunk/drivers/mtd/tests/mtd_speedtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* Test read and write speed of a MTD device.
*
* Author: Adrian Hunter <ext-adrian.hunter@nokia.com>
* Author: Adrian Hunter <adrian.hunter@nokia.com>
*/

#include <linux/init.h>
Expand All @@ -33,6 +33,11 @@ static int dev;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(dev, "MTD device number to use");

static int count;
module_param(count, int, S_IRUGO);
MODULE_PARM_DESC(count, "Maximum number of eraseblocks to use "
"(0 means use all)");

static struct mtd_info *mtd;
static unsigned char *iobuf;
static unsigned char *bbt;
Expand Down Expand Up @@ -326,7 +331,10 @@ static int __init mtd_speedtest_init(void)

printk(KERN_INFO "\n");
printk(KERN_INFO "=================================================\n");
printk(PRINT_PREF "MTD device: %d\n", dev);
if (count)
printk(PRINT_PREF "MTD device: %d count: %d\n", dev, count);
else
printk(PRINT_PREF "MTD device: %d\n", dev);

mtd = get_mtd_device(NULL, dev);
if (IS_ERR(mtd)) {
Expand All @@ -353,6 +361,9 @@ static int __init mtd_speedtest_init(void)
(unsigned long long)mtd->size, mtd->erasesize,
pgsize, ebcnt, pgcnt, mtd->oobsize);

if (count > 0 && count < ebcnt)
ebcnt = count;

err = -ENOMEM;
iobuf = kmalloc(mtd->erasesize, GFP_KERNEL);
if (!iobuf) {
Expand Down

0 comments on commit a372be8

Please sign in to comment.