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]
Date:   Thu, 11 Nov 2021 11:08:06 +0100
From:   Christian König <christian.koenig@....com>
To:     Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
        alexander.deucher@....com
Cc:     Xinhui.Pan@....com, airlied@...ux.ie, daniel@...ll.ch,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/amd/display: clean up some inconsistent indenting

Am 11.11.21 um 10:58 schrieb Jiapeng Chong:
> Eliminate the follow smatch warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2245
> dp_dsc_slice_bpg_offset_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2044
> dp_dsc_pic_width_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2101
> dp_dsc_pic_height_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:2173
> dp_dsc_chunk_size_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1868
> dp_dsc_bits_per_pixel_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1965
> dp_dsc_bits_per_pixel_write() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1787
> dp_dsc_slice_height_write() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1602
> dp_dsc_slice_width_write() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1687
> dp_dsc_slice_height_read() warn: inconsistent indenting.
>
> vers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1417
> dp_dsc_clock_en_write() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1502
> dp_dsc_slice_width_read() warn: inconsistent indenting.
>
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_debugfs.c:1315
> dp_dsc_clock_en_read() warn: inconsistent indenting.
>
> Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>

Looks like the same code was copied over and over again, maybe make this 
an even wider cleanup and add a helper function to find the pipe_ctx for 
a specific dc_link.

Regards,
Christian.

> ---
>   .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c  | 72 +++++++++++-----------
>   1 file changed, 36 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 9d43ecb..50ef248 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -1312,9 +1312,9 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -1414,9 +1414,9 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, const char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx || !pipe_ctx->stream)
> @@ -1499,9 +1499,9 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -1599,9 +1599,9 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, const char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx || !pipe_ctx->stream)
> @@ -1684,9 +1684,9 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -1784,9 +1784,9 @@ static ssize_t dp_dsc_slice_height_write(struct file *f, const char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx || !pipe_ctx->stream)
> @@ -1865,9 +1865,9 @@ static ssize_t dp_dsc_bits_per_pixel_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -1962,9 +1962,9 @@ static ssize_t dp_dsc_bits_per_pixel_write(struct file *f, const char __user *bu
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx || !pipe_ctx->stream)
> @@ -2041,9 +2041,9 @@ static ssize_t dp_dsc_pic_width_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -2098,9 +2098,9 @@ static ssize_t dp_dsc_pic_height_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -2170,9 +2170,9 @@ static ssize_t dp_dsc_chunk_size_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)
> @@ -2242,9 +2242,9 @@ static ssize_t dp_dsc_slice_bpg_offset_read(struct file *f, char __user *buf,
>   
>   	for (i = 0; i < MAX_PIPES; i++) {
>   		pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
> -			if (pipe_ctx && pipe_ctx->stream &&
> -			    pipe_ctx->stream->link == aconnector->dc_link)
> -				break;
> +		if (pipe_ctx && pipe_ctx->stream &&
> +		    pipe_ctx->stream->link == aconnector->dc_link)
> +			break;
>   	}
>   
>   	if (!pipe_ctx)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ