Skip to contentSkip to conversation

drm/amd/display: Fix unsigned comparison to zero

PATCH Applied Zou Wei 2 participants 2 messages Apr 30, 2020

Subsystems (3)
lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 drm/amd/display: Fix unsigned comparison to zero

Fixes coccicheck warning:

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c:1398:60-61:
WARNING: Unsigned expression compared with zero: j >= 0

Fixes 238387774232 ("drm/amd/display: fix rn soc bb update")
---
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -1
index ceaf70a..419cdde 100644
@@ -1384,7 +1384,8 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
 	struct dcn21_resource_pool *pool = TO_DCN21_RES_POOL(dc->res_pool);
 	struct clk_limit_table *clk_table = &bw_params->clk_table;
 	struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
-	unsigned int i, j, closest_clk_lvl;
+	unsigned int i, closest_clk_lvl;
+	int j;
 
 	// Default clock levels are used for diags, which may lead to overclocking.
 	if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
Signature · 1 line
2.6.2
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 30 lines · Zou Wei

Fixes coccicheck warning:

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c:1398:60-61:
WARNING: Unsigned expression compared with zero: j >= 0

Fixes 238387774232 ("drm/amd/display: fix rn soc bb update")
---
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -2
index ceaf70a..419cdde 100644
@@ -1384,7 +1384,8 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param
        struct dcn21_resource_pool *pool = TO_DCN21_RES_POOL(dc->res_pool);
        struct clk_limit_table *clk_table = &bw_params->clk_table;
        struct _vcs_dpi_voltage_scaling_st clock_limits[DC__VOLTAGE_STATES];
-       unsigned int i, j, closest_clk_lvl;
+       unsigned int i, closest_clk_lvl;
+       int j;
 
        // Default clock levels are used for diags, which may lead to overclocking.
        if (!IS_DIAG_DC(dc->ctx->dce_environment)) {
--

2.6.2

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel