Loading arch/arm/kernel/atags_proc.c +10 −18 Original line number Diff line number Diff line Loading @@ -9,23 +9,17 @@ struct buffer { char data[]; }; static int read_buffer(char* page, char** start, off_t off, int count, int* eof, void* data) static ssize_t atags_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct buffer *buffer = (struct buffer *)data; if (off >= buffer->size) { *eof = 1; return 0; struct buffer *b = PDE(file_inode(file))->data; return simple_read_from_buffer(buf, count, ppos, b->data, b->size); } count = min((int) (buffer->size - off), count); memcpy(page, &buffer->data[off], count); return count; } static const struct file_operations atags_fops = { .read = atags_read, .llseek = default_llseek, }; #define BOOT_PARAMS_SIZE 1536 static char __initdata atags_copy[BOOT_PARAMS_SIZE]; Loading Loading @@ -66,9 +60,7 @@ static int __init init_atags_procfs(void) b->size = size; memcpy(b->data, atags_copy, size); tags_entry = create_proc_read_entry("atags", 0400, NULL, read_buffer, b); tags_entry = proc_create_data("atags", 0400, NULL, &atags_fops, b); if (!tags_entry) goto nomem; Loading Loading
arch/arm/kernel/atags_proc.c +10 −18 Original line number Diff line number Diff line Loading @@ -9,23 +9,17 @@ struct buffer { char data[]; }; static int read_buffer(char* page, char** start, off_t off, int count, int* eof, void* data) static ssize_t atags_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct buffer *buffer = (struct buffer *)data; if (off >= buffer->size) { *eof = 1; return 0; struct buffer *b = PDE(file_inode(file))->data; return simple_read_from_buffer(buf, count, ppos, b->data, b->size); } count = min((int) (buffer->size - off), count); memcpy(page, &buffer->data[off], count); return count; } static const struct file_operations atags_fops = { .read = atags_read, .llseek = default_llseek, }; #define BOOT_PARAMS_SIZE 1536 static char __initdata atags_copy[BOOT_PARAMS_SIZE]; Loading Loading @@ -66,9 +60,7 @@ static int __init init_atags_procfs(void) b->size = size; memcpy(b->data, atags_copy, size); tags_entry = create_proc_read_entry("atags", 0400, NULL, read_buffer, b); tags_entry = proc_create_data("atags", 0400, NULL, &atags_fops, b); if (!tags_entry) goto nomem; Loading