]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Fix unsigned comparison to zero
authorZou Wei <zou_wei@huawei.com>
Thu, 30 Apr 2020 03:56:02 +0000 (11:56 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Apr 2020 20:49:17 +0000 (16:49 -0400)
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: a6a0ab659866 ("drm/amd/display: fix rn soc bb update")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

index ceaf70a934c3e221334958de0f196372efa7ab81..419cdde624f5eae34b8bf41de31cae1e96a6d06a 100644 (file)
@@ -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)) {