[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread Daniel Vetter
On Thu, Mar 13, 2014 at 1:28 PM, Thomas Hellstrom wrote: > But a compiler can't (or shouldn't) make that assumption. Just as an > (adapted) example, imagine that > each test had a 20% probability of returning an error. The probability > of the function returning an error would > then be 68%.. Ot

[PATCH 2/5] drm: Break out ioctl permission check to a separate function v2

2014-03-13 Thread Thomas Hellstrom
Helps reviewing and understanding these checks. v2: Remove misplaced newlines. Signed-off-by: Thomas Hellstrom Reviewed-by: David Herrmann --- drivers/gpu/drm/drm_drv.c | 113 ++--- 1 file changed, 75 insertions(+), 38 deletions(-) diff --git a/drivers/

[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread Thomas Hellstrom
On 03/13/2014 01:15 PM, David Herrmann wrote: > Hi > > On Thu, Mar 13, 2014 at 1:11 PM, Thomas Hellstrom > wrote: >> 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

[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread David Herrmann
Hi On Thu, Mar 13, 2014 at 1:11 PM, Thomas Hellstrom wrote: > 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 >> wrote: > ... > > -

[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread Thomas Hellstrom
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 > wrote: ... - if (cmd & IOC_IN) { - if (copy_from_user(kdata,

[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread David Herrmann
Hi On Thu, Mar 13, 2014 at 11:57 AM, Thomas Hellstrom wrote: > Helps reviewing and understanding these checks. > > Signed-off-by: Thomas Hellstrom > --- > drivers/gpu/drm/drm_drv.c | 116 > ++--- > 1 file changed, 78 insertions(+), 38 deletions(-) > > d

[PATCH 2/5] drm: Break out ioctl permission check to a separate function

2014-03-13 Thread Thomas Hellstrom
Helps reviewing and understanding these checks. Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/drm_drv.c | 116 ++--- 1 file changed, 78 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 345be03.