From: Chen Gang <gang.chen@asianux.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kernel/itimer.c: for return value, using -EINVAL instead of -EFAULT
Date: Thu, 20 Jun 2013 16:16:40 +0800 [thread overview]
Message-ID: <51C2BA68.8050301@asianux.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1306200936470.4013@ionos.tec.linutronix.de>
On 06/20/2013 03:44 PM, Thomas Gleixner wrote:
> We could do that, but that makes no sense. If we can detect it before
> copy_to_user() we can return the exactly same return value which we
> would return via copy_to_user(). That avoids to take a trap and run
> through the fixup code
I don't think "that makes no sense".
In most cases, the 'value' will not be NULL, so it is better for
performance (save one compare instruction, at least).
Also, it will make the code simpler and clearer for readers.
Thanks.
--
Chen Gang
Asianux Corporation
prev parent reply other threads:[~2013-06-20 8:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 6:22 [PATCH] kernel/itimer.c: for return value, using -EINVAL instead of -EFAULT Chen Gang
2013-06-20 6:59 ` Thomas Gleixner
2013-06-20 7:18 ` Chen Gang
2013-06-20 7:44 ` Thomas Gleixner
2013-06-20 8:16 ` Chen Gang [this message]
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=51C2BA68.8050301@asianux.com \
--to=gang.chen@asianux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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