[PATCH v4 14/15] drm/bridge: tc358767: Drop unnecessary 8 byte buffer

Andrzej Hajda a.hajda at samsung.com
Fri Jun 7 06:41:18 UTC 2019


On 07.06.2019 06:45, Andrey Smirnov wrote:
> tc_get_display_props() never reads more than a byte via AUX, so
> there's no need to reserve 8 for that purpose. No function change
> intended.
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
Reviewed-by: Andrzej Hajda <a.hajda at samsung.com>

 --
Regards
Andrzej
> Cc: Andrzej Hajda <a.hajda at samsung.com>
> Cc: Laurent Pinchart <Laurent.pinchart at ideasonboard.com>
> Cc: Tomi Valkeinen <tomi.valkeinen at ti.com>
> Cc: Andrey Gusakov <andrey.gusakov at cogentembedded.com>
> Cc: Philipp Zabel <p.zabel at pengutronix.de>
> Cc: Cory Tusar <cory.tusar at zii.aero>
> Cc: Chris Healy <cphealy at gmail.com>
> Cc: Lucas Stach <l.stach at pengutronix.de>
> Cc: dri-devel at lists.freedesktop.org
> Cc: linux-kernel at vger.kernel.org
> ---
>  drivers/gpu/drm/bridge/tc358767.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
> index e747f10021e3..4a245144aa83 100644
> --- a/drivers/gpu/drm/bridge/tc358767.c
> +++ b/drivers/gpu/drm/bridge/tc358767.c
> @@ -661,8 +661,7 @@ static int tc_aux_link_setup(struct tc_data *tc)
>  static int tc_get_display_props(struct tc_data *tc)
>  {
>  	int ret;
> -	/* temp buffer */
> -	u8 tmp[8];
> +	u8 reg;
>  
>  	/* Read DP Rx Link Capability */
>  	ret = drm_dp_link_probe(&tc->aux, &tc->link.base);
> @@ -678,21 +677,21 @@ static int tc_get_display_props(struct tc_data *tc)
>  		tc->link.base.num_lanes = 2;
>  	}
>  
> -	ret = drm_dp_dpcd_readb(&tc->aux, DP_MAX_DOWNSPREAD, tmp);
> +	ret = drm_dp_dpcd_readb(&tc->aux, DP_MAX_DOWNSPREAD, &reg);
>  	if (ret < 0)
>  		goto err_dpcd_read;
> -	tc->link.spread = tmp[0] & DP_MAX_DOWNSPREAD_0_5;
> +	tc->link.spread = reg & DP_MAX_DOWNSPREAD_0_5;
>  
> -	ret = drm_dp_dpcd_readb(&tc->aux, DP_MAIN_LINK_CHANNEL_CODING, tmp);
> +	ret = drm_dp_dpcd_readb(&tc->aux, DP_MAIN_LINK_CHANNEL_CODING, &reg);
>  	if (ret < 0)
>  		goto err_dpcd_read;
>  
>  	tc->link.scrambler_dis = false;
>  	/* read assr */
> -	ret = drm_dp_dpcd_readb(&tc->aux, DP_EDP_CONFIGURATION_SET, tmp);
> +	ret = drm_dp_dpcd_readb(&tc->aux, DP_EDP_CONFIGURATION_SET, &reg);
>  	if (ret < 0)
>  		goto err_dpcd_read;
> -	tc->link.assr = tmp[0] & DP_ALTERNATE_SCRAMBLER_RESET_ENABLE;
> +	tc->link.assr = reg & DP_ALTERNATE_SCRAMBLER_RESET_ENABLE;
>  
>  	dev_dbg(tc->dev, "DPCD rev: %d.%d, rate: %s, lanes: %d, framing: %s\n",
>  		tc->link.base.revision >> 4, tc->link.base.revision & 0x0f,




More information about the dri-devel mailing list