diff mbox

[04/14] drm/sti: Remove pointless casts

Message ID 20180615164925.28971-5-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä June 15, 2018, 4:49 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/sti/sti_tvout.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Benjamin Gaignard June 18, 2018, 7:53 a.m. UTC | #1
2018-06-15 18:49 GMT+02:00 Ville Syrjala <ville.syrjala@linux.intel.com>:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Thanks.

> ---
>  drivers/gpu/drm/sti/sti_tvout.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index ea4a3b87fa55..7d495307fe79 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -665,7 +665,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;
> @@ -718,7 +718,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;
> @@ -767,7 +767,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;
> --
> 2.16.4
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
index ea4a3b87fa55..7d495307fe79 100644
--- a/drivers/gpu/drm/sti/sti_tvout.c
+++ b/drivers/gpu/drm/sti/sti_tvout.c
@@ -665,7 +665,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;
@@ -718,7 +718,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;
@@ -767,7 +767,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;