drm/sti: Remove pointless casts
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 8 Jul 2019 16:20:37 +0000 (19:20 +0300)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Tue, 9 Jul 2019 07:44:25 +0000 (09:44 +0200)
There's no point in the cast for accessing the base class. Just
take the address of the struct instead.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708162048.4286-4-ville.syrjala@linux.intel.com
drivers/gpu/drm/sti/sti_tvout.c

index e1b3c8c..42f4c26 100644 (file)
@@ -669,7 +669,7 @@ sti_tvout_create_dvo_encoder(struct drm_device *dev,
 
        encoder->tvout = tvout;
 
-       drm_encoder = (struct drm_encoder *)encoder;
+       drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
        drm_encoder->possible_clones = 1 << 0;
@@ -722,7 +722,7 @@ static struct drm_encoder *sti_tvout_create_hda_encoder(struct drm_device *dev,
 
        encoder->tvout = tvout;
 
-       drm_encoder = (struct drm_encoder *) encoder;
+       drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
        drm_encoder->possible_clones = 1 << 0;
@@ -771,7 +771,7 @@ static struct drm_encoder *sti_tvout_create_hdmi_encoder(struct drm_device *dev,
 
        encoder->tvout = tvout;
 
-       drm_encoder = (struct drm_encoder *) encoder;
+       drm_encoder = &encoder->encoder;
 
        drm_encoder->possible_crtcs = ENCODER_CRTC_MASK;
        drm_encoder->possible_clones = 1 << 1;