11 #include <linux/module.h>
24 #define PROC_FIFO "int-fifo"
47 static const int expected_result[
FIFO_SIZE] = {
48 3, 4, 5, 6, 7, 8, 9, 0,
49 1, 20, 21, 22, 23, 24, 25, 26,
50 27, 28, 29, 30, 31, 32, 33, 34,
51 35, 36, 37, 38, 39, 40, 41, 42,
54 static int __init testfunc(
void)
63 for (i = 0; i != 10; i++)
94 if (i != expected_result[j++]) {
109 size_t count, loff_t *ppos)
121 return ret ? ret : copied;
124 static ssize_t fifo_read(
struct file *file,
char __user *buf,
125 size_t count, loff_t *ppos)
137 return ret ? ret : copied;
147 static int __init example_init(
void)
158 if (testfunc() < 0) {
174 static void __exit example_exit(
void)