[PATCH] drm/print: Include drm_device.h
Simona Vetter
simona.vetter at ffwll.ch
Wed Jan 22 11:11:53 UTC 2025
On Tue, Jan 21, 2025 at 06:09:25PM -0300, Gustavo Sousa wrote:
> The header drm_print.h uses members of struct drm_device pointers, as
> such, it should include drm_device.h to let the compiler know the full
> type definition.
>
> Without such include, users of drm_print.h that don't explicitly need
> drm_device.h would bump into build errors and be forced to include the
> latter.
>
> Signed-off-by: Gustavo Sousa <gustavo.sousa at intel.com>
> ---
> include/drm/drm_print.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index f77fe1531cf8..9732f514566d 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -32,6 +32,7 @@
> #include <linux/dynamic_debug.h>
>
> #include <drm/drm.h>
> +#include <drm/drm_device.h>
We much prefer just a struct device forward decl to avoid monster headers.
Is that not doable here? Worst case I'd convert the drm_info_printer()
static inline to a macro, not sure about the exact rules here if you
never deref a pointer.
-Sima
>
> struct debugfs_regset32;
> struct drm_device;
> --
> 2.48.1
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list