All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: drm_gem.h: Add explicit includes for DEFINE_DRM_GEM_FOPS
@ 2022-04-29 19:55 ` Jeffrey Hugo
  0 siblings, 0 replies; 8+ messages in thread
From: Jeffrey Hugo @ 2022-04-29 19:55 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
  Cc: Jeffrey Hugo, linux-kernel, dri-devel

DEFINE_DRM_GEM_FOPS() references drm functions from other headers.  For
example drm_open() is defined in drm_file.h and drm_ioctl() is defined
in drm_ioctl.h.  Since drm_gem.h doesn't include these headers, it
relies on an implicit include from the .c file to have included these
required headers before DEFINE_DRM_GEM_FOPS() gets used.  Relying on
these implicit includes can cause build failures for new code that
doesn't know about these requirements, and can lead to future problems
if the headers ever get restructured as there will be a need to update
every downstream file that includes drm_gem.h.

Lets fix this explicitly including the required headers in drm_gem.h so
that code that includes drm_gem.h does not need to worry about these
implicit dependencies.

Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
---
 include/drm/drm_gem.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 9d7c61a..1cbe3d8 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -37,6 +37,8 @@
 #include <linux/kref.h>
 #include <linux/dma-resv.h>
 
+#include <drm/drm_file.h>
+#include <drm/drm_ioctl.h>
 #include <drm/drm_vma_manager.h>
 
 struct iosys_map;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-05  8:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29 19:55 [PATCH] drm: drm_gem.h: Add explicit includes for DEFINE_DRM_GEM_FOPS Jeffrey Hugo
2022-04-29 19:55 ` Jeffrey Hugo
2022-05-02 15:41 ` Jani Nikula
2022-05-04  9:38   ` Daniel Vetter
2022-05-04  9:38     ` Daniel Vetter
2022-05-04 13:58     ` Jeffrey Hugo
2022-05-05  8:28       ` Daniel Vetter
2022-05-05  8:28         ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.