diff mbox

[07/20] drm: replace weird conditional includes

Message ID 1409307166-12396-8-git-send-email-dh.herrmann@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Herrmann Aug. 29, 2014, 10:12 a.m. UTC
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>
---
 drivers/gpu/drm/drm_vm.c |  1 +
 include/drm/drmP.h       | 10 +---------
 2 files changed, 2 insertions(+), 9 deletions(-)

Comments

Thierry Reding Aug. 29, 2014, 11:45 a.m. UTC | #1
On Fri, Aug 29, 2014 at 12:12:33PM +0200, David Herrmann wrote:
> 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>
> ---
>  drivers/gpu/drm/drm_vm.c |  1 +
>  include/drm/drmP.h       | 10 +---------
>  2 files changed, 2 insertions(+), 9 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c
index be25174..967e570 100644
--- a/drivers/gpu/drm/drm_vm.c
+++ b/drivers/gpu/drm/drm_vm.c
@@ -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 {
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 7a3c73c..31fb300 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -36,12 +36,7 @@ 
 #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>