Messages in this thread | | | Date | Tue, 8 Nov 2011 00:14:02 +0000 | From | Alan Cox <> | Subject | Re: [PATCH] ramoops: Add a device file for ramoops buffer access. |
| |
> +static int ramoops_open(struct inode *inode, struct file *file) > +{ > + file->private_data = &oops_cxt;
Well I guess you'll only have one..
> + if (copy_to_user(buf, from, count)) > + count = -EFAULT; > + else > + *ppos += count;
Mindnumbingly pedantically you should return -EFAULT only if none of the bytes copied, otherwise the partial length. Do we actually care in a case like this - not really.
Looks good to me and we really want to get away from using /dev/mem for stuff. Ideally to a world where /dev/mem can be compiled out of any normal system completely so
Acked-by: Alan Cox <alan@linux.intel.com>
| |