#define pr_fmt(fmt) …
#include <linux/init.h>
#include <linux/ktime.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 "mtd_test.h"
#define RETRIES …
static int eb = …;
module_param(eb, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int ebcnt = …;
module_param(ebcnt, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int pgcnt;
module_param(pgcnt, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int dev = …;
module_param(dev, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int gran = …;
module_param(gran, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static int check = …;
module_param(check, int, S_IRUGO);
MODULE_PARM_DESC(…) …;
static unsigned int cycles_count;
module_param(cycles_count, uint, S_IRUGO);
MODULE_PARM_DESC(…) …;
static struct mtd_info *mtd;
static unsigned char *patt_5A5;
static unsigned char *patt_A5A;
static unsigned char *patt_FF;
static unsigned char *check_buf;
static unsigned int erase_cycles;
static int pgsize;
static ktime_t start, finish;
static void report_corrupt(unsigned char *read, unsigned char *written);
static inline void start_timing(void)
{ … }
static inline void stop_timing(void)
{ … }
static inline int check_eraseblock(int ebnum, unsigned char *buf)
{ … }
static inline int write_pattern(int ebnum, void *buf)
{ … }
static int __init tort_init(void)
{ … }
module_init(tort_init);
static void __exit tort_exit(void)
{ … }
module_exit(tort_exit);
static int countdiffs(unsigned char *buf, unsigned char *check_buf,
unsigned offset, unsigned len, unsigned *bytesp,
unsigned *bitsp);
static void print_bufs(unsigned char *read, unsigned char *written, int start,
int len);
static void report_corrupt(unsigned char *read, unsigned char *written)
{ … }
static void print_bufs(unsigned char *read, unsigned char *written, int start,
int len)
{ … }
static int countdiffs(unsigned char *buf, unsigned char *check_buf,
unsigned offset, unsigned len, unsigned *bytesp,
unsigned *bitsp)
{ … }
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;