mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
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>
This commit is contained in:
@@ -219,17 +219,11 @@ struct vc4_vec {
|
||||
writel(val, vec->regs + (offset)); \
|
||||
} while (0)
|
||||
|
||||
static inline struct vc4_vec *
|
||||
encoder_to_vc4_vec(struct drm_encoder *encoder)
|
||||
{
|
||||
return container_of(encoder, struct vc4_vec, encoder.base);
|
||||
}
|
||||
#define encoder_to_vc4_vec(_encoder) \
|
||||
container_of_const(_encoder, struct vc4_vec, encoder.base)
|
||||
|
||||
static inline struct vc4_vec *
|
||||
connector_to_vc4_vec(struct drm_connector *connector)
|
||||
{
|
||||
return container_of(connector, struct vc4_vec, connector);
|
||||
}
|
||||
#define connector_to_vc4_vec(_connector) \
|
||||
container_of_const(_connector, struct vc4_vec, connector)
|
||||
|
||||
enum vc4_vec_tv_mode_id {
|
||||
VC4_VEC_TV_MODE_NTSC,
|
||||
|
||||
Reference in New Issue
Block a user