Skip to contentSkip to conversation

drm/amd/display: Remove duplicate/repeating expression

PATCH Applied Deepak R Varma 3 participants 4 messages Feb 10, 2023 – Feb 15, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Remove duplicate/repeating expression

Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch.

---
 .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +1 -1
index 61ee9ba063a7..6576b897a512 100644
@@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 4;
 		*BytePerPixelC = 0;
-	} else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
+	} else if (SourcePixelFormat == dm_444_16) {
 		*BytePerPixelDETY = 2;
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 2;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Deepak R Varma

Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch.

Harry

Quoted 17 lines
---
 .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +1 -1
index 61ee9ba063a7..6576b897a512 100644
@@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 4;
 		*BytePerPixelC = 0;
-	} else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
+	} else if (SourcePixelFormat == dm_444_16) {
 		*BytePerPixelDETY = 2;
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 2;
#2 lore raw
Quoted 8 lines · Harry Wentland
Quoted 5 lines · Deepak R Varma

Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch.

Thank you Harry. There is another similar patch I submitted for a different file. Could you please also review that and share your feedback?

Thank you,
./drv

Quoted 21 lines

Harry

Quoted 17 lines
---
 .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +1 -1
index 61ee9ba063a7..6576b897a512 100644
@@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 4;
 		*BytePerPixelC = 0;
-	} else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
+	} else if (SourcePixelFormat == dm_444_16) {
 		*BytePerPixelDETY = 2;
 		*BytePerPixelDETC = 0;
 		*BytePerPixelY = 2;
Applied
#3 lore raw
In reply to Harry Wentland

Applied. Thanks!

Quoted 30 lines · Harry Wentland
Quoted 5 lines · Deepak R Varma

Remove duplicate or repeating expressions in the if condition evaluation. Issue identified using doubletest.cocci Coccinelle semantic patch.

Harry

Quoted 17 lines
---
 .../gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +1 -1
index 61ee9ba063a7..6576b897a512 100644
@@ -51,7 +51,7 @@ static bool CalculateBytePerPixelAnd256BBlockSizes(
              *BytePerPixelDETC = 0;
              *BytePerPixelY = 4;
              *BytePerPixelC = 0;
-     } else if (SourcePixelFormat == dm_444_16 || SourcePixelFormat == dm_444_16) {
+     } else if (SourcePixelFormat == dm_444_16) {
              *BytePerPixelDETY = 2;
              *BytePerPixelDETC = 0;
              *BytePerPixelY = 2;