summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vc4/tests/vc4_mock.h
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2023-03-06 11:46:42 +0100
committerMaxime Ripard <maxime@cerno.tech>2023-04-25 09:32:25 +0200
commit5a46e490e47e4d821c382288108f193fc88a9282 (patch)
tree301fdd26bffd35e575679430e7c1bf45abb8743b /drivers/gpu/drm/vc4/tests/vc4_mock.h
parent322d716a3e8a74fb75cd0f657647be4df253fd2f (diff)
drm/vc4: Switch to container_of_const
container_of_const() allows to preserve the pointer constness and is thus more flexible than inline functions. Let's switch all our instances of container_of() to container_of_const(). Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221207-rpi-hdmi-improvements-v3-1-bdd54f66884e@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/vc4/tests/vc4_mock.h')
-rw-r--r--drivers/gpu/drm/vc4/tests/vc4_mock.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock.h b/drivers/gpu/drm/vc4/tests/vc4_mock.h
index db8e9a141ef84..2d0b339bd9f39 100644
--- a/drivers/gpu/drm/vc4/tests/vc4_mock.h
+++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h
@@ -43,6 +43,9 @@ struct vc4_dummy_output {
struct drm_connector connector;
};
+#define encoder_to_vc4_dummy_output(_enc) \
+ container_of_const(_enc, struct vc4_dummy_output, encoder.base)
+
struct vc4_dummy_output *vc4_dummy_output(struct kunit *test,
struct drm_device *drm,
struct drm_crtc *crtc,