#define pr_fmt(fmt) …
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/err.h>
#include <linux/mtd/mtd.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/random.h>
#include "mtd_test.h"
static int dev = …;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static struct mtd_info *mtd;
static unsigned char *writebuf;
static unsigned char *readbuf;
static unsigned char *bbt;
static int subpgsize;
static int bufsize;
static int ebcnt;
static int pgcnt;
static int errcnt;
static struct rnd_state rnd_state;
static inline void clear_data(unsigned char *buf, size_t len)
{ … }
static int write_eraseblock(int ebnum)
{ … }
static int write_eraseblock2(int ebnum)
{ … }
static void print_subpage(unsigned char *p)
{ … }
static int verify_eraseblock(int ebnum)
{ … }
static int verify_eraseblock2(int ebnum)
{ … }
static int verify_eraseblock_ff(int ebnum)
{ … }
static int verify_all_eraseblocks_ff(void)
{ … }
static int __init mtd_subpagetest_init(void)
{ … }
module_init(mtd_subpagetest_init);
static void __exit mtd_subpagetest_exit(void)
{ … }
module_exit(mtd_subpagetest_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;