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.
Showing the changes to include (3 of 3 files). Show all
Unified · Split
| @@ -3,7 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | #ifndef DRM_GEM_TTM_HELPER_H |
| 4 | 4 | #define DRM_GEM_TTM_HELPER_H |
| 5 | 5 | |
| 6 | −#include <linux/kernel.h> | |
| 6 | +#include <linux/container_of.h> | |
| 7 | 7 | |
| 8 | 8 | #include <drm/drm_device.h> |
| 9 | 9 | #include <drm/drm_gem.h> |
| @@ -11,8 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | #include <drm/ttm/ttm_bo_api.h> |
| 12 | 12 | #include <drm/ttm/ttm_bo_driver.h> |
| 13 | 13 | |
| 14 | +#include <linux/container_of.h> | |
| 14 | 15 | #include <linux/dma-buf-map.h> |
| 15 | −#include <linux/kernel.h> /* for container_of() */ | |
| 16 | 16 | |
| 17 | 17 | struct drm_mode_create_dumb; |
| 18 | 18 | struct drm_plane; |
| @@ -39,13 +39,15 @@ · 38 unmodified lines | ||
| 39 | 39 | */ |
| 40 | 40 | #include <linux/bug.h> |
| 41 | 41 | #include <linux/rbtree.h> |
| 42 | −#include <linux/kernel.h> | |
| 42 | +#include <linux/limits.h> | |
| 43 | 43 | #include <linux/mm_types.h> |
| 44 | 44 | #include <linux/list.h> |
| 45 | 45 | #include <linux/spinlock.h> |
| 46 | 46 | #ifdef CONFIG_DRM_DEBUG_MM |
| 47 | 47 | #include <linux/stackdepot.h> |
| 48 | 48 | #endif |
| 49 | +#include <linux/types.h> | |
| 50 | + | |
| 49 | 51 | #include <drm/drm_print.h> |
| 50 | 52 | |
| 51 | 53 | #ifdef CONFIG_DRM_DEBUG_MM |