Skip to contentSkip to conversation

drm/amd/display: fix cond_no_effect.cocci warnings

PATCH Applied [email protected] 2 participants 2 messages Nov 12, 2021

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

PATCH 1/1 drm/amd/display: fix cond_no_effect.cocci warnings

From: Ye Guojin <[email protected]>

This was found by coccicheck:
./drivers/gpu/drm/amd/display/dc/core/dc_resource.c, 2516, 7-9, WARNING possible condition with no effect (if == else)

hdmi_info.bits.YQ0_YQ1 is always YYC_QUANTIZATION_LIMITED_RANGE.

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -11
index fabe1b83bd4f..564163a85d2c 100644
@@ -2509,17 +2509,7 @@ static void set_avi_info_frame(
 
 	/* TODO : We should handle YCC quantization */
 	/* but we do not have matrix calculation */
-	if (stream->qy_bit == 1) {
-		if (color_space == COLOR_SPACE_SRGB ||
-			color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
-			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-		else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
-					color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
-			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-		else
-			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-	} else
-		hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
+	hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
 
 	///VIC
 	format = stream->timing.timing_3d_format;
Signature · 1 line
2.25.1
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 41 lines · On Fri, Nov 12, 2021 at 1:17 AM <[email protected]> wrote:

From: Ye Guojin <[email protected]>

This was found by coccicheck:
./drivers/gpu/drm/amd/display/dc/core/dc_resource.c, 2516, 7-9, WARNING possible condition with no effect (if == else)

hdmi_info.bits.YQ0_YQ1 is always YYC_QUANTIZATION_LIMITED_RANGE.

---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -12
index fabe1b83bd4f..564163a85d2c 100644
@@ -2509,17 +2509,7 @@ static void set_avi_info_frame(
 
        /* TODO : We should handle YCC quantization */
        /* but we do not have matrix calculation */
-       if (stream->qy_bit == 1) {
-               if (color_space == COLOR_SPACE_SRGB ||
-                       color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
-                       hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-               else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
-                                       color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
-                       hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-               else
-                       hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-       } else
-               hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
+       hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
 
        ///VIC
        format = stream->timing.timing_3d_format;
--

2.25.1