drm: replace weird conditional includes
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 29 Aug 2014 10:12:33 +0000 (12:12 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Sep 2014 07:40:35 +0000 (17:40 +1000)
pte_wrprotect() is only used by drm_vm.c, so move the include there. Also
include it unconditionally, all architectures provide this header!

Furthermore, replace asm/current.h with sched.h, which includes
asm/current.h unconditionally. This way we get the same effect and avoid
direct asm/ includes. Furthermore, drop the weird __alpha__ protection.
It's safe to include sched.h everywhere (and the wait.h comment doesn't
apply, anyway).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_vm.c
include/drm/drmP.h

index be25174f10e4eac9d292e88068694356f36976e7..967e570bb0d16597fd2c1a6c22e8d37df7dc2d64 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/efi.h>
 #include <linux/slab.h>
 #endif
+#include <asm/pgtable.h>
 #include "drm_legacy.h"
 
 struct drm_vma_entry {
index 7a3c73c5375ddb8466d3f01d957c2dea06680e91..31fb3004777075375a1fcf3f060e94dc0d42d3e7 100644 (file)
 #define _DRM_P_H_
 
 #ifdef __KERNEL__
-#ifdef __alpha__
-/* add include of current.h so that "current" is defined
- * before static inline funcs in wait.h. Doing this so we
- * can build the DRM (part of PI DRI). 4/21/2000 S + B */
-#include <asm/current.h>
-#endif                         /* __alpha__ */
+#include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/kref.h>
 #include <linux/miscdevice.h>
@@ -58,9 +53,6 @@
 #include <linux/io.h>
 #include <linux/slab.h>
 #include <linux/ratelimit.h>
-#if defined(__alpha__) || defined(__powerpc__)
-#include <asm/pgtable.h>       /* For pte_wrprotect */
-#endif
 #include <asm/mman.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>