LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0002-drm-i915-Add-u64_to_user_ptr-macro.patch of Package drm (Project home:tiwai:bnc1050256)

From f45fe576c01da207e849d219e85afcce3d00ed91 Mon Sep 17 00:00:00 2001
From: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Date: Wed, 29 Mar 2017 11:36:12 +0200
Subject: [PATCH 02/12] drm/i915: Add u64_to_user_ptr() macro

Signed-off-by: Patrik Jakobsson <pjakobsson@suse.de>
---
 drivers/gpu/drm/i915/i915_drv.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index da832d3..28e5382 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -72,6 +72,13 @@
 #define DRIVER_DESC		"Intel Graphics"
 #define DRIVER_DATE		"20160919"
 
+#define u64_to_user_ptr(x) (		\
+{					\
+	typecheck(u64, x);		\
+	(void __user *)(uintptr_t)x;	\
+}					\
+)
+
 #undef WARN_ON
 /* Many gcc seem to no see through this and fall over :( */
 #if 0
-- 
2.12.0