Skip to contentSkip to conversation

drm/amd/display: remove unreachable code

PATCH In review Jiapeng Chong 2 participants 2 messages Aug 12, 2022

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

PATCH 1/1 drm/amd/display: remove unreachable code

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_util_32.c:1658 dml32_TruncToValidBPP() warn: ignoring unreachable code.

---
 .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c   | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +0 -4
index 05fc14a47fba..0758e1da55a9 100644
@@ -1654,10 +1654,6 @@ double dml32_TruncToValidBPP(
 		else
 			return DesiredBPP;
 	}
-
-	*RequiredSlots = dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1);
-
-	return BPP_INVALID;
 } // TruncToValidBPP
 
 double dml32_RequiredDTBCLK(
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 14 lines · Jiapeng Chong

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/display_mode_vba_util_32.c:1658 dml32_TruncToValidBPP() warn: ignoring unreachable code.

---
  .../drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c   | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +0 -0
index 05fc14a47fba..0758e1da55a9 100644

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c double dml32_TruncToValidBPP( · line 1659

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +0 -4
@@ -1654,10 +1654,6 @@ double dml32_TruncToValidBPP(
  		else
  			return DesiredBPP;
  	}
-
-	*RequiredSlots = dml_ceil(DesiredBPP / MaxLinkBPP * 64, 1);
-
-	return BPP_INVALID;
  } // TruncToValidBPP
 
  double dml32_RequiredDTBCLK(

Seems correct.

I feel like RequiredSlots is not actually used anywhere in the code, just passed around dml32_TruncToValidBPP() and dml32_CalculateOutputLink(). I've looked for any mentions of it in the mailing list, but could not find anything that implied it's part of ground working. I wonder if it's something outside the Linux tree for other platforms or related to HW gospel.