lkml.org 
[lkml]   [2011]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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>


\
 
 \ /
  Last update: 2011-11-08 01:17    [W:0.047 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site