From: Maxime Ripard <maxime@cerno.tech>
To: Emma Anholt <emma@anholt.net>, Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Maxime Ripard <maxime@cerno.tech>
Subject: [PATCH 2/9] drm/vc4: hdmi: Constify container_of wrappers
Date: Wed, 07 Dec 2022 17:07:46 +0100 [thread overview]
Message-ID: <20221207-rpi-hdmi-improvements-v1-2-6b15f774c13a@cerno.tech> (raw)
In-Reply-To: <20221207-rpi-hdmi-improvements-v1-0-6b15f774c13a@cerno.tech>
None of our wrappers around container_of to access our objects from the
DRM object pointer actually modify the latter.
Let's make them const.
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
drivers/gpu/drm/vc4/vc4_hdmi.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h
index dc3ccd8002a0..023ea64ef006 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.h
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.h
@@ -224,13 +224,13 @@ struct vc4_hdmi {
};
static inline struct vc4_hdmi *
-connector_to_vc4_hdmi(struct drm_connector *connector)
+connector_to_vc4_hdmi(const struct drm_connector *connector)
{
return container_of(connector, struct vc4_hdmi, connector);
}
static inline struct vc4_hdmi *
-encoder_to_vc4_hdmi(struct drm_encoder *encoder)
+encoder_to_vc4_hdmi(const struct drm_encoder *encoder)
{
struct vc4_encoder *_encoder = to_vc4_encoder(encoder);
return container_of(_encoder, struct vc4_hdmi, encoder);
@@ -244,7 +244,7 @@ struct vc4_hdmi_connector_state {
};
static inline struct vc4_hdmi_connector_state *
-conn_state_to_vc4_hdmi_conn_state(struct drm_connector_state *conn_state)
+conn_state_to_vc4_hdmi_conn_state(const struct drm_connector_state *conn_state)
{
return container_of(conn_state, struct vc4_hdmi_connector_state, base);
}
--
2.38.1
next prev parent reply other threads:[~2022-12-07 16:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 16:07 [PATCH 0/9] drm/vc4: hdmi: Broadcast RGB, BT601, BT2020 Maxime Ripard
2022-12-07 16:07 ` [PATCH 1/9] drm/vc4: hdmi: Update all the planes if the TV margins are changed Maxime Ripard
2023-01-11 13:56 ` Thomas Zimmermann
2022-12-07 16:07 ` Maxime Ripard [this message]
2023-01-11 14:02 ` [PATCH 2/9] drm/vc4: hdmi: Constify container_of wrappers Thomas Zimmermann
2023-01-11 14:17 ` Jani Nikula
2022-12-07 16:07 ` [PATCH 3/9] drm/vc4: hdmi: Add Broadcast RGB property to allow override of RGB range Maxime Ripard
2023-01-11 14:11 ` Thomas Zimmermann
2023-01-26 9:38 ` Maxime Ripard
2022-12-07 16:07 ` [PATCH 4/9] drm/vc4: hdmi: Rename full range helper Maxime Ripard
2023-01-11 14:13 ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 5/9] drm/vc4: hdmi: Rework the CSC matrices organization Maxime Ripard
2023-01-11 15:03 ` Thomas Zimmermann
2023-01-11 17:00 ` Dave Stevenson
2023-01-26 13:40 ` Maxime Ripard
2022-12-07 16:07 ` [PATCH 6/9] drm/vc4: hdmi: Swap CSC matrix channels for YUV444 Maxime Ripard
2023-01-11 15:05 ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 7/9] drm/vc4: hdmi: Add a function to retrieve the CSC matrix Maxime Ripard
2023-01-11 15:14 ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 8/9] drm/vc4: hdmi: Add BT.601 Support Maxime Ripard
2023-01-11 15:16 ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 9/9] drm/vc4: hdmi: Add BT.2020 Support Maxime Ripard
2023-01-11 15:18 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221207-rpi-hdmi-improvements-v1-2-6b15f774c13a@cerno.tech \
--to=maxime@cerno.tech \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).