From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Bryan Freed <bfreed@chromium.org>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
msb@chromium.org, marco.stornelli@gmail.com,
seiji.aguchi@hds.com
Subject: Re: [PATCH] ramoops: Add a device file for ramoops buffer access.
Date: Tue, 8 Nov 2011 00:14:02 +0000 [thread overview]
Message-ID: <20111108001402.3d1a8fb4@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <1320710760-2734-1-git-send-email-bfreed@chromium.org>
> +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>
next prev parent reply other threads:[~2011-11-08 0:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-08 0:06 Bryan Freed
2011-11-08 0:14 ` Alan Cox [this message]
2011-11-08 0:36 ` Kees Cook
2011-11-08 1:04 ` Bryan Freed
2011-11-08 1:33 ` H. Peter Anvin
2011-11-08 7:58 ` Marco Stornelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111108001402.3d1a8fb4@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@linux-foundation.org \
--cc=bfreed@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=msb@chromium.org \
--cc=seiji.aguchi@hds.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®