When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used.
Unified · Split
| @@ -3,7 +3,7 @@ · 2 unmodified lines | |||
| 3 | #ifndef DRM_GEM_TTM_HELPER_H | 3 | #ifndef DRM_GEM_TTM_HELPER_H |
| 4 | #define DRM_GEM_TTM_HELPER_H | 4 | #define DRM_GEM_TTM_HELPER_H |
| 5 | 5 | ||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/container_of.h> |
| 7 | 7 | ||
| 8 | #include <drm/drm_device.h> | 8 | #include <drm/drm_device.h> |
| 9 | #include <drm/drm_gem.h> | 9 | #include <drm/drm_gem.h> |
| @@ -11,8 +11,8 @@ · 10 unmodified lines | |||
| 11 | #include <drm/ttm/ttm_bo_api.h> | 11 | #include <drm/ttm/ttm_bo_api.h> |
| 12 | #include <drm/ttm/ttm_bo_driver.h> | 12 | #include <drm/ttm/ttm_bo_driver.h> |
| 13 | 13 | ||
| 14 | #include <linux/container_of.h> | ||
| 14 | #include <linux/dma-buf-map.h> | 15 | #include <linux/dma-buf-map.h> |
| 15 | #include <linux/kernel.h> /* for container_of() */ | ||
| 16 | 16 | ||
| 17 | struct drm_mode_create_dumb; | 17 | struct drm_mode_create_dumb; |
| 18 | struct drm_plane; | 18 | struct drm_plane; |
| @@ -39,13 +39,15 @@ · 38 unmodified lines | |||
| 39 | */ | 39 | */ |
| 40 | #include <linux/bug.h> | 40 | #include <linux/bug.h> |
| 41 | #include <linux/rbtree.h> | 41 | #include <linux/rbtree.h> |
| 42 | #include <linux/kernel.h> | 42 | #include <linux/limits.h> |
| 43 | #include <linux/mm_types.h> | 43 | #include <linux/mm_types.h> |
| 44 | #include <linux/list.h> | 44 | #include <linux/list.h> |
| 45 | #include <linux/spinlock.h> | 45 | #include <linux/spinlock.h> |
| 46 | #ifdef CONFIG_DRM_DEBUG_MM | 46 | #ifdef CONFIG_DRM_DEBUG_MM |
| 47 | #include <linux/stackdepot.h> | 47 | #include <linux/stackdepot.h> |
| 48 | #endif | 48 | #endif |
| 49 | #include <linux/types.h> | ||
| 50 | |||
| 49 | #include <drm/drm_print.h> | 51 | #include <drm/drm_print.h> |
| 50 | 52 | ||
| 51 | #ifdef CONFIG_DRM_DEBUG_MM | 53 | #ifdef CONFIG_DRM_DEBUG_MM |