[Intel-gfx] [PATCH] drm/i915: Add to_user_ptr()

Daniel Vetter daniel at ffwll.ch
Sun Mar 3 19:50:47 CET 2013


On Fri, Feb 22, 2013 at 02:29:44PM +0000, Chris Wilson wrote:
> On Fri, Feb 22, 2013 at 04:12:51PM +0200, ville.syrjala at linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > to_user_ptr() simply casts a pointer passed as u64 from user space
> > to void __user * correctly. Using this lets us get rid of all the
> > tiresome casts.
> > 
> > The idea came from Chris Wilson <chris at chris-wilson.co.uk>.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>.
Queued for -next, thanks for the patch. I do wonder whether we shouldn't
push this as a more general solution as e.g. ioclt_u64_to_user_ptr. It
should be best practice after all to use u64 for userpointers in ioctl
structs ... Maybe send out an rfc to lkml cc a few people?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list