lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2c6b5c55-92dc-4f7d-758b-5b4f69f28482@linaro.org>
Date:   Wed, 31 May 2023 11:15:29 +0200
From:   Neil Armstrong <neil.armstrong@...aro.org>
To:     Lu Hongfei <luhongfei@...o.com>,
        Artur Weber <aweber.kernel@...il.com>,
        Sam Ravnborg <sam@...nborg.org>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        "open list:DRM PANEL DRIVERS" <dri-devel@...ts.freedesktop.org>,
        open list <linux-kernel@...r.kernel.org>
Cc:     opensource.kernel@...o.com
Subject: Re: [PATCH] gpu: drm/panel: Change the return value of s6d7aa0_lock
 to void

On 31/05/2023 09:37, Lu Hongfei wrote:
> The return value of s6d7aa0_lock is meaningless,

It is not, mipi_dsi_dcs_write_seq() can return an error value:

https://github.com/torvalds/linux/blob/master/include/drm/drm_mipi_dsi.h#L320

Neil

> it is better to modify it to void.
> This patch fixes this issue and modifies the place
> where s6d7aa0_lock is called.
> 
> Signed-off-by: Lu Hongfei <luhongfei@...o.com>
> ---
>   drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 29 ++++---------------
>   1 file changed, 5 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> index 102e1fc7ee38..c5924e7b9e36
> --- a/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c
> @@ -63,10 +63,9 @@ static void s6d7aa0_reset(struct s6d7aa0 *ctx)
>   	msleep(50);
>   }
>   
> -static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
> +static void s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
>   {
>   	struct mipi_dsi_device *dsi = ctx->dsi;
> -	int ret = 0;
>   
>   	if (lock) {
>   		mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD1, 0xa5, 0xa5);
> @@ -79,8 +78,6 @@ static int s6d7aa0_lock(struct s6d7aa0 *ctx, bool lock)
>   		if (ctx->desc->use_passwd3)
>   			mipi_dsi_dcs_write_seq(dsi, MCS_PASSWD3, 0xa5, 0xa5);
>   	}
> -
> -	return ret;
>   }
>   
>   static int s6d7aa0_on(struct s6d7aa0 *ctx)
> @@ -238,11 +235,7 @@ static int s6d7aa0_lsl080al02_init(struct s6d7aa0 *ctx)
>   
>   	usleep_range(20000, 25000);
>   
> -	ret = s6d7aa0_lock(ctx, false);
> -	if (ret < 0) {
> -		dev_err(dev, "Failed to unlock registers: %d\n", ret);
> -		return ret;
> -	}
> +	s6d7aa0_lock(ctx, false);
>   
>   	mipi_dsi_dcs_write_seq(dsi, MCS_OTP_RELOAD, 0x00, 0x10);
>   	usleep_range(1000, 1500);
> @@ -266,11 +259,7 @@ static int s6d7aa0_lsl080al02_init(struct s6d7aa0 *ctx)
>   	msleep(120);
>   	mipi_dsi_dcs_write_seq(dsi, MIPI_DCS_SET_ADDRESS_MODE, 0x00);
>   
> -	ret = s6d7aa0_lock(ctx, true);
> -	if (ret < 0) {
> -		dev_err(dev, "Failed to lock registers: %d\n", ret);
> -		return ret;
> -	}
> +	s6d7aa0_lock(ctx, true);
>   
>   	ret = mipi_dsi_dcs_set_display_on(dsi);
>   	if (ret < 0) {
> @@ -327,11 +316,7 @@ static int s6d7aa0_lsl080al03_init(struct s6d7aa0 *ctx)
>   
>   	usleep_range(20000, 25000);
>   
> -	ret = s6d7aa0_lock(ctx, false);
> -	if (ret < 0) {
> -		dev_err(dev, "Failed to unlock registers: %d\n", ret);
> -		return ret;
> -	}
> +	s6d7aa0_lock(ctx, false);
>   
>   	if (ctx->desc->panel_type == S6D7AA0_PANEL_LSL080AL03) {
>   		mipi_dsi_dcs_write_seq(dsi, MCS_BL_CTL, 0xc7, 0x00, 0x29);
> @@ -370,11 +355,7 @@ static int s6d7aa0_lsl080al03_init(struct s6d7aa0 *ctx)
>   		return ret;
>   	}
>   
> -	ret = s6d7aa0_lock(ctx, true);
> -	if (ret < 0) {
> -		dev_err(dev, "Failed to lock registers: %d\n", ret);
> -		return ret;
> -	}
> +	s6d7aa0_lock(ctx, true);
>   
>   	ret = mipi_dsi_dcs_set_display_on(dsi);
>   	if (ret < 0) {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ