dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: Re: [PATCH 9/9] drm: rcar-du: Drop local encoder variable
Date: Mon, 14 Dec 2020 17:16:34 +0000	[thread overview]
Message-ID: <dc05fa55-a46b-e693-c58f-8c03ce28c185@ideasonboard.com> (raw)
In-Reply-To: <20201204220139.15272-10-laurent.pinchart+renesas@ideasonboard.com>

Hi Laurent,

On 04/12/2020 22:01, Laurent Pinchart wrote:
> The local encoder variable is an alias for &renc->base, and is only use
> twice. It doesn't help much, drop it, along with the
> rcar_encoder_to_drm_encoder() macro that is then unused.

It does seem overkill to have a macro for only a single (variable
instantiation) usage, so this makes sense.

And now there's 4 lines less code ... That's always a win :-D

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>


> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 6 ++----
>  drivers/gpu/drm/rcar-du/rcar_du_encoder.h | 2 --
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> index 49c0b27e2f5a..9a565bd3380d 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
> @@ -61,7 +61,6 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  			 struct device_node *enc_node)
>  {
>  	struct rcar_du_encoder *renc;
> -	struct drm_encoder *encoder;
>  	struct drm_bridge *bridge;
>  	int ret;
>  
> @@ -108,12 +107,11 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  
>  	rcdu->encoders[output] = renc;
>  	renc->output = output;
> -	encoder = rcar_encoder_to_drm_encoder(renc);
>  
>  	dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n",
>  		enc_node, output);
>  
> -	ret = drm_encoder_init(&rcdu->ddev, encoder, &rcar_du_encoder_funcs,
> +	ret = drm_encoder_init(&rcdu->ddev, &renc->base, &rcar_du_encoder_funcs,
>  			       DRM_MODE_ENCODER_NONE, NULL);
>  	if (ret < 0)
>  		goto error;
> @@ -127,7 +125,7 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  	 * Attach the bridge to the encoder. The bridge will create the
>  	 * connector.
>  	 */
> -	return drm_bridge_attach(encoder, bridge, NULL, 0);
> +	return drm_bridge_attach(&renc->base, bridge, NULL, 0);
>  
>  error:
>  	kfree(renc);
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
> index df9be4524301..73560563fb31 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.h
> @@ -22,8 +22,6 @@ struct rcar_du_encoder {
>  #define to_rcar_encoder(e) \
>  	container_of(e, struct rcar_du_encoder, base)
>  
> -#define rcar_encoder_to_drm_encoder(e)	(&(e)->base)
> -
>  int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  			 enum rcar_du_output output,
>  			 struct device_node *enc_node);
> 

-- 
Regards
--
Kieran
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2020-12-14 17:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 22:01 [PATCH 0/9] drm: rcar-du: Fix LVDS-related crash Laurent Pinchart
2020-12-04 22:01 ` [PATCH 1/9] drm: rcar-du: Fix crash when using LVDS1 clock for CRTC Laurent Pinchart
2020-12-07  8:15   ` Geert Uytterhoeven
2020-12-08  0:42     ` Laurent Pinchart
2020-12-14  9:43   ` Jacopo Mondi
2020-12-14 15:36   ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 2/9] drm: rcar-du: Release vsp device reference in all error paths Laurent Pinchart
2020-12-14 10:03   ` Jacopo Mondi
2020-12-14 15:42   ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 3/9] drm: rcar-du: Drop unneeded encoder cleanup in error path Laurent Pinchart
2020-12-14 10:11   ` Jacopo Mondi
2020-12-14 13:19     ` Laurent Pinchart
2020-12-14 15:59   ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 4/9] drm: rcar-du: Use DRM-managed allocation for VSP planes Laurent Pinchart
2020-12-14 16:20   ` Kieran Bingham
2020-12-14 16:26     ` Laurent Pinchart
2020-12-15 15:42       ` Geert Uytterhoeven
2020-12-04 22:01 ` [PATCH 5/9] drm: rcar-du: Use DRM-managed allocation for encoders Laurent Pinchart
2020-12-14 10:37   ` Jacopo Mondi
2020-12-14 13:28     ` Laurent Pinchart
2020-12-04 22:01 ` [PATCH 6/9] drm: rcar-du: Embed drm_device in rcar_du_device Laurent Pinchart
2020-12-14 10:55   ` Jacopo Mondi
2020-12-14 17:02   ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 7/9] drm: rcar-du: Replace dev_private with container_of Laurent Pinchart
2020-12-14 10:58   ` Jacopo Mondi
2020-12-14 17:11     ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 8/9] drm: rcar-du: Skip encoder allocation for LVDS1 in dual-link mode Laurent Pinchart
2020-12-14 11:04   ` Jacopo Mondi
2020-12-14 13:32     ` Laurent Pinchart
2020-12-14 17:21   ` Kieran Bingham
2020-12-04 22:01 ` [PATCH 9/9] drm: rcar-du: Drop local encoder variable Laurent Pinchart
2020-12-14 11:05   ` Jacopo Mondi
2020-12-14 17:16   ` Kieran Bingham [this message]

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=dc05fa55-a46b-e693-c58f-8c03ce28c185@ideasonboard.com \
    --to=kieran.bingham@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.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