drm/amd/pm: suppress static checker warning
authorEvan Quan <evan.quan@amd.com>
Wed, 26 Aug 2020 03:28:19 +0000 (11:28 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Aug 2020 14:09:00 +0000 (10:09 -0400)
Suppress the warning below:
drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:274 phm_check_smc_update_required_for_display_configuration()
warn: signedness bug returning '(-22)'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/powerplay/hwmgr/hardwaremanager.c

index 9454ab5..1f9b9fa 100644 (file)
@@ -271,7 +271,10 @@ int phm_start_thermal_controller(struct pp_hwmgr *hwmgr)
 
 bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)
 {
-       PHM_FUNC_CHECK(hwmgr);
+       if (hwmgr == NULL ||
+           hwmgr->hwmgr_func == NULL)
+               return false;
+
        if (hwmgr->pp_one_vf)
                return false;