From: Thomas Hellstrom <thellstrom@vmware.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>,
Thomas Hellstrom <thellstrom@vmware.com>,
linux-graphics-maintainer@vmware.com,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/5] drm: Break out ioctl permission check to a separate function
Date: Thu, 13 Mar 2014 13:11:12 +0100 [thread overview]
Message-ID: <5321A060.8090406@vmware.com> (raw)
In-Reply-To: <CANq1E4ShMH3gend4=xkPaKUpChW8zWPC+DgVc-U+4OAm3zZrxw@mail.gmail.com>
Hi.
Thanks for reviewing. I'll incorporate your suggestions, except this
one, and resend.
On 03/13/2014 12:19 PM, David Herrmann wrote:
> Hi
>
> On Thu, Mar 13, 2014 at 11:57 AM, Thomas Hellstrom
> <thellstrom@vmware.com> wrote:
...
- if (cmd & IOC_IN) {
- if (copy_from_user(kdata, (void __user *)arg,
- usize) != 0) {
- retcode = -EFAULT;
+ retcode = drm_ioctl_permit(ioctl->flags, file_priv);
+ if (unlikely(retcode))
> That "unlikely" seems redundant given that all error paths in
> drm_ioctl_permit() already are "unlikely".
Yes, we know that's true, but I don't think compilers in general can
combine branch prediction hints in that way,
or even have the information necessary to do it.
I mean even if each individual test resulting in an error is unlikely,
how could the compiler know that
all tests combined would result in an error being unlikely?
/Thomas
next prev parent reply other threads:[~2014-03-13 12:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 10:57 (unknown), Thomas Hellstrom
2014-03-13 10:57 ` [PATCH 1/5] drm: Have the crtc code only reference master from legacy nodes Thomas Hellstrom
2014-03-13 11:12 ` David Herrmann
2014-03-13 10:57 ` [PATCH 2/5] drm: Break out ioctl permission check to a separate function Thomas Hellstrom
2014-03-13 11:19 ` David Herrmann
2014-03-13 12:11 ` Thomas Hellstrom [this message]
2014-03-13 12:15 ` David Herrmann
2014-03-13 12:28 ` Thomas Hellstrom
2014-03-13 18:47 ` Daniel Vetter
2014-03-13 10:57 ` [PATCH 3/5] drm: Make control nodes master-less v2 Thomas Hellstrom
2014-03-13 11:23 ` David Herrmann
2014-03-13 10:57 ` [PATCH 4/5] drm: Improve on minor type helpers Thomas Hellstrom
2014-03-13 10:57 ` [PATCH 5/5] drm: Remove the minor master list Thomas Hellstrom
2014-03-13 11:01 ` [PATCH 0/5] Control node master fixes WAS: Thomas Hellstrom
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=5321A060.8090406@vmware.com \
--to=thellstrom@vmware.com \
--cc=airlied@redhat.com \
--cc=dh.herrmann@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-graphics-maintainer@vmware.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