linux/drivers/gpu/drm/amd/pm
Srinivasan Shanmugam e81a492d12 drm/amd/pm: smu7: Remove stale error check in smu7_hwmgr_backend_init
smu7_hwmgr_backend_init() is responsible for initializing the SMU7 power
management backend. It allocates and sets up the backend structure,
initializes voltage tables, configures dependency tables, and prepares
platform-specific power and clock parameters.

The function follows a typical pattern where each initialization step
returns a status in "result", and failures are handled via a common
"goto fail" path that performs cleanup.

Commit 2c21648bb814 ("drm/amd/pm/smu7: Remove non-functional SMU7
voltage dependency on DAL") removed a function call in this
initialization sequence, but left behind the corresponding error check.

As a result, "result" is checked twice without being updated in between:

    result = smu7_init_voltage_dependency_on_display_clock_table(hwmgr);
    if (result)
        goto fail;

    ...

    if (result)
        goto fail;

The second check is redundant and unreachable for any new failure, since
no operation modifies "result" between the two checks. This triggers a
Smatch warning about a duplicate zero check and reduces code clarity.

Remove the stale error check to keep the control flow correct and
readable.

Fixes: 9f49e3d4cb ("drm/amd/pm/smu7: Remove non-functional SMU7 voltage dependency on DAL")
Reported-by: Dan Carpenter <error27@gmail.com>
Cc: Timur Kristóf <timur.kristof@gmail.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-04-17 14:49:54 -04:00
..
inc drm/amd/pm: add smu ras driver framework 2025-11-04 11:53:58 -05:00
legacy-dpm drm/amdgpu: apply state adjust rules to some additional HAINAN vairants 2026-03-17 17:44:03 -04:00
powerplay drm/amd/pm: smu7: Remove stale error check in smu7_hwmgr_backend_init 2026-04-17 14:49:54 -04:00
swsmu drm/amd/pm: fix incorrect FeatureCtrlMask setting on smu v14.0.x 2026-04-17 14:45:04 -04:00
amdgpu_dpm_internal.c drm/amd/pm: Remove unneeded legacy DPM related code. 2025-09-15 16:52:50 -04:00
amdgpu_dpm.c drm/amd/pm: fix race in power state check before mutex lock 2026-01-27 18:11:27 -05:00
amdgpu_pm.c drm/amd/pm: Use str_enabled_disabled in amdgpu_pm sysfs 2026-03-30 14:33:48 -04:00
Makefile drm/amd: Enable SMU 15_0_0 support 2026-01-08 11:41:42 -05:00