All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: remove useless else if
@ 2020-12-21 11:16 ` Tian Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Tian Tao @ 2020-12-21 11:16 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	airlied, daniel, Bhawanpreet.Lakha, Joshua.Aberback,
	Rodrigo.Siqueira, aurabindo.pillai, Ashley.Thomas2, Jing.Zhou,
	Chris.Park
  Cc: dri-devel, amd-gfx

Fix the following coccinelle report:
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c:1357:6-8:
WARNING: possible condition with no effect (if == else)

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
index 808c4dc..504f2a4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
@@ -1354,8 +1354,6 @@ static bool dcn302_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
 		dc->debug = debug_defaults_diags;
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: remove useless else if
@ 2020-12-21 11:16 ` Tian Tao
  0 siblings, 0 replies; 13+ messages in thread
From: Tian Tao @ 2020-12-21 11:16 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
	airlied, daniel, Bhawanpreet.Lakha, Joshua.Aberback,
	Rodrigo.Siqueira, aurabindo.pillai, Ashley.Thomas2, Jing.Zhou,
	Chris.Park
  Cc: dri-devel, amd-gfx

Fix the following coccinelle report:
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c:1357:6-8:
WARNING: possible condition with no effect (if == else)

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
index 808c4dc..504f2a4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
@@ -1354,8 +1354,6 @@ static bool dcn302_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
 		dc->debug = debug_defaults_diags;
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/amd/display: remove useless else if
  2020-12-21 11:16 ` Tian Tao
@ 2021-01-04 16:57   ` Alex Deucher
  -1 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2021-01-04 16:57 UTC (permalink / raw)
  To: Tian Tao
  Cc: Joshua Aberback, Ashley.Thomas2, Chris Park, Leo (Sunpeng) Li,
	Bhawanpreet Lakha, Siqueira, Rodrigo,
	Maling list - DRI developers, Jing.Zhou, Dave Airlie,
	Aurabindo Pillai, amd-gfx list, Deucher, Alexander,
	Christian Koenig

On Mon, Dec 21, 2020 at 9:40 AM Tian Tao <tiantao6@hisilicon.com> wrote:
>
> Fix the following coccinelle report:
> drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c:1357:6-8:
> WARNING: possible condition with no effect (if == else)
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> index 808c4dc..504f2a4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> @@ -1354,8 +1354,6 @@ static bool dcn302_resource_construct(
>
>         if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
>                 dc->debug = debug_defaults_drv;
> -       else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
> -               dc->debug = debug_defaults_diags;
>         else
>                 dc->debug = debug_defaults_diags;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/amd/display: remove useless else if
@ 2021-01-04 16:57   ` Alex Deucher
  0 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2021-01-04 16:57 UTC (permalink / raw)
  To: Tian Tao
  Cc: Joshua Aberback, Ashley.Thomas2, Chris Park, Leo (Sunpeng) Li,
	Bhawanpreet Lakha, Siqueira, Rodrigo,
	Maling list - DRI developers, Jing.Zhou, Dave Airlie,
	Aurabindo Pillai, amd-gfx list, Daniel Vetter, Deucher,
	Alexander, Wentland, Harry, Christian Koenig

On Mon, Dec 21, 2020 at 9:40 AM Tian Tao <tiantao6@hisilicon.com> wrote:
>
> Fix the following coccinelle report:
> drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c:1357:6-8:
> WARNING: possible condition with no effect (if == else)
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> index 808c4dc..504f2a4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
> @@ -1354,8 +1354,6 @@ static bool dcn302_resource_construct(
>
>         if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
>                 dc->debug = debug_defaults_drv;
> -       else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
> -               dc->debug = debug_defaults_diags;
>         else
>                 dc->debug = debug_defaults_diags;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/amd/display: Remove useless else if
  2023-01-12  3:20 ` Jiapeng Chong
  (?)
@ 2023-01-12 19:07   ` Alex Deucher
  -1 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2023-01-12 19:07 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: sunpeng.li, Rodrigo.Siqueira, Xinhui.Pan, Abaci Robot,
	linux-kernel, amd-gfx, dri-devel, alexander.deucher,
	christian.koenig

Applied.  Thanks!

On Wed, Jan 11, 2023 at 10:21 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> The assignment of the else and if branches is the same, so the if else
> here is redundant, so we remove it.
>
> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 4300ce98ce8d..aa3024e58d12 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
>                 dmub_asic = DMUB_ASIC_DCN21;
>                 break;
>         case IP_VERSION(3, 0, 0):
> -               if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
> -                       dmub_asic = DMUB_ASIC_DCN30;
> -               else
> -                       dmub_asic = DMUB_ASIC_DCN30;
> +               dmub_asic = DMUB_ASIC_DCN30;
>                 break;
>         case IP_VERSION(3, 0, 1):
>                 dmub_asic = DMUB_ASIC_DCN301;
> --
> 2.20.1.7.g153144c
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/amd/display: Remove useless else if
@ 2023-01-12 19:07   ` Alex Deucher
  0 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2023-01-12 19:07 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: sunpeng.li, Rodrigo.Siqueira, Xinhui.Pan, Abaci Robot,
	linux-kernel, amd-gfx, dri-devel, alexander.deucher,
	harry.wentland, christian.koenig

Applied.  Thanks!

On Wed, Jan 11, 2023 at 10:21 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> The assignment of the else and if branches is the same, so the if else
> here is redundant, so we remove it.
>
> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 4300ce98ce8d..aa3024e58d12 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
>                 dmub_asic = DMUB_ASIC_DCN21;
>                 break;
>         case IP_VERSION(3, 0, 0):
> -               if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
> -                       dmub_asic = DMUB_ASIC_DCN30;
> -               else
> -                       dmub_asic = DMUB_ASIC_DCN30;
> +               dmub_asic = DMUB_ASIC_DCN30;
>                 break;
>         case IP_VERSION(3, 0, 1):
>                 dmub_asic = DMUB_ASIC_DCN301;
> --
> 2.20.1.7.g153144c
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/amd/display: Remove useless else if
@ 2023-01-12 19:07   ` Alex Deucher
  0 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2023-01-12 19:07 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: harry.wentland, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel,
	alexander.deucher, christian.koenig

Applied.  Thanks!

On Wed, Jan 11, 2023 at 10:21 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> The assignment of the else and if branches is the same, so the if else
> here is redundant, so we remove it.
>
> ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 4300ce98ce8d..aa3024e58d12 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
>                 dmub_asic = DMUB_ASIC_DCN21;
>                 break;
>         case IP_VERSION(3, 0, 0):
> -               if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
> -                       dmub_asic = DMUB_ASIC_DCN30;
> -               else
> -                       dmub_asic = DMUB_ASIC_DCN30;
> +               dmub_asic = DMUB_ASIC_DCN30;
>                 break;
>         case IP_VERSION(3, 0, 1):
>                 dmub_asic = DMUB_ASIC_DCN301;
> --
> 2.20.1.7.g153144c
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2023-01-12  3:20 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2023-01-12  3:20 UTC (permalink / raw)
  To: harry.wentland
  Cc: sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, amd-gfx,
	dri-devel, linux-kernel, Jiapeng Chong, Abaci Robot

The assignment of the else and if branches is the same, so the if else
here is redundant, so we remove it.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4300ce98ce8d..aa3024e58d12 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
 		dmub_asic = DMUB_ASIC_DCN21;
 		break;
 	case IP_VERSION(3, 0, 0):
-		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
-			dmub_asic = DMUB_ASIC_DCN30;
-		else
-			dmub_asic = DMUB_ASIC_DCN30;
+		dmub_asic = DMUB_ASIC_DCN30;
 		break;
 	case IP_VERSION(3, 0, 1):
 		dmub_asic = DMUB_ASIC_DCN301;
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2023-01-12  3:20 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2023-01-12  3:20 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel,
	alexander.deucher, christian.koenig

The assignment of the else and if branches is the same, so the if else
here is redundant, so we remove it.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4300ce98ce8d..aa3024e58d12 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
 		dmub_asic = DMUB_ASIC_DCN21;
 		break;
 	case IP_VERSION(3, 0, 0):
-		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
-			dmub_asic = DMUB_ASIC_DCN30;
-		else
-			dmub_asic = DMUB_ASIC_DCN30;
+		dmub_asic = DMUB_ASIC_DCN30;
 		break;
 	case IP_VERSION(3, 0, 1):
 		dmub_asic = DMUB_ASIC_DCN301;
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2023-01-12  3:20 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2023-01-12  3:20 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, dri-devel, daniel,
	alexander.deucher, airlied, christian.koenig

The assignment of the else and if branches is the same, so the if else
here is redundant, so we remove it.

./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1951:2-4: WARNING: possible condition with no effect (if == else).

Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3719
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 4300ce98ce8d..aa3024e58d12 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1948,10 +1948,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
 		dmub_asic = DMUB_ASIC_DCN21;
 		break;
 	case IP_VERSION(3, 0, 0):
-		if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 3, 0))
-			dmub_asic = DMUB_ASIC_DCN30;
-		else
-			dmub_asic = DMUB_ASIC_DCN30;
+		dmub_asic = DMUB_ASIC_DCN30;
 		break;
 	case IP_VERSION(3, 0, 1):
 		dmub_asic = DMUB_ASIC_DCN301;
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2022-07-29  3:41 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2022-07-29  3:41 UTC (permalink / raw)
  To: harry.wentland
  Cc: sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
	christian.koenig, Xinhui.Pan, airlied, daniel, amd-gfx,
	dri-devel, linux-kernel, Jiapeng Chong, Abaci Robot

The assignment of the else and else if branches is the same, so the else
if here is redundant, so we remove it and add a comment to make the code
here readable.

Eliminate the follow coccicheck warning:

./drivers/comedi/drivers/das1800.c:1300:8-10: WARNING: possible
condition with no effect (if == else).

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
index 63861cdfb09f..02bea8f0c8c9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
@@ -2132,10 +2132,10 @@ static bool dcn314_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
+	/* This branch contains condition '(dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)' */
 		dc->debug = debug_defaults_diags;
+
 	// Init the vm_helper
 	if (dc->vm_helper)
 		vm_helper_init(dc->vm_helper, 16);
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2022-07-29  3:41 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2022-07-29  3:41 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, airlied, dri-devel,
	alexander.deucher, christian.koenig

The assignment of the else and else if branches is the same, so the else
if here is redundant, so we remove it and add a comment to make the code
here readable.

Eliminate the follow coccicheck warning:

./drivers/comedi/drivers/das1800.c:1300:8-10: WARNING: possible
condition with no effect (if == else).

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
index 63861cdfb09f..02bea8f0c8c9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
@@ -2132,10 +2132,10 @@ static bool dcn314_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
+	/* This branch contains condition '(dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)' */
 		dc->debug = debug_defaults_diags;
+
 	// Init the vm_helper
 	if (dc->vm_helper)
 		vm_helper_init(dc->vm_helper, 16);
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] drm/amd/display: Remove useless else if
@ 2022-07-29  3:41 ` Jiapeng Chong
  0 siblings, 0 replies; 13+ messages in thread
From: Jiapeng Chong @ 2022-07-29  3:41 UTC (permalink / raw)
  To: harry.wentland
  Cc: Jiapeng Chong, sunpeng.li, Abaci Robot, Xinhui.Pan,
	Rodrigo.Siqueira, linux-kernel, amd-gfx, airlied, dri-devel,
	daniel, alexander.deucher, christian.koenig

The assignment of the else and else if branches is the same, so the else
if here is redundant, so we remove it and add a comment to make the code
here readable.

Eliminate the follow coccicheck warning:

./drivers/comedi/drivers/das1800.c:1300:8-10: WARNING: possible
condition with no effect (if == else).

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
index 63861cdfb09f..02bea8f0c8c9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
@@ -2132,10 +2132,10 @@ static bool dcn314_resource_construct(
 
 	if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
 		dc->debug = debug_defaults_drv;
-	else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)
-		dc->debug = debug_defaults_diags;
 	else
+	/* This branch contains condition '(dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS)' */
 		dc->debug = debug_defaults_diags;
+
 	// Init the vm_helper
 	if (dc->vm_helper)
 		vm_helper_init(dc->vm_helper, 16);
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-01-12 19:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 11:16 [PATCH] drm/amd/display: remove useless else if Tian Tao
2020-12-21 11:16 ` Tian Tao
2021-01-04 16:57 ` Alex Deucher
2021-01-04 16:57   ` Alex Deucher
2022-07-29  3:41 [PATCH] drm/amd/display: Remove " Jiapeng Chong
2022-07-29  3:41 ` Jiapeng Chong
2022-07-29  3:41 ` Jiapeng Chong
2023-01-12  3:20 Jiapeng Chong
2023-01-12  3:20 ` Jiapeng Chong
2023-01-12  3:20 ` Jiapeng Chong
2023-01-12 19:07 ` Alex Deucher
2023-01-12 19:07   ` Alex Deucher
2023-01-12 19:07   ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.