linux/drivers/gpu/drm/amd/pm/powerplay/hwmgr
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
..
ci_baco.c drm/amdgpu: Clean up errors in ci_baco.c 2023-08-09 09:40:46 -04:00
ci_baco.h
common_baco.c drm/amdgpu: Clean up errors in common_baco.c 2023-08-09 09:40:42 -04:00
common_baco.h
fiji_baco.c drm/amd/pm: Clean up errors in fiji_baco.c 2023-08-09 09:40:31 -04:00
fiji_baco.h
hardwaremanager.c drm/amdgpu: Remove phm_powerdown_uvd 2025-03-05 10:44:29 -05:00
hwmgr_ppt.h
hwmgr.c drm/amd/pm/ci: Disable MCLK DPM on problematic CI ASICs 2026-03-30 16:44:54 -04:00
Makefile
polaris_baco.c drm/amd/pm: Clean up errors in polaris_baco.c 2023-08-09 09:41:18 -04:00
polaris_baco.h
pp_overdriver.c
pp_overdriver.h
pp_psm.c drm/amd/pm: check negtive return for table entries 2024-05-13 16:12:02 -04:00
pp_psm.h
ppatomctrl.c drm/amd/pm/powerplay/hwmgr/ppatomctrl: Remove redundant ternary operators 2025-09-05 17:38:39 -04:00
ppatomctrl.h drm/amd/powerplay: Delete unused function and maths library 2024-10-01 17:42:24 -04:00
ppatomfwctrl.c drm/amdgpu: Remove ppatomfwctrl deadcode 2025-03-05 10:43:11 -05:00
ppatomfwctrl.h drm/amdgpu: Remove ppatomfwctrl deadcode 2025-03-05 10:43:11 -05:00
pppcielanes.c
pppcielanes.h
pptable_v1_0.h drm/amd/pm: powerplay: Add __counted_by attribute for flexible arrays 2024-06-19 12:52:25 -04:00
process_pptables_v1_0.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
process_pptables_v1_0.h
processpptables.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
processpptables.h
smu_helper.c drm/amd/pm/smu7: Remove non-functional SMU7 voltage dependency on DAL 2026-03-30 16:48:11 -04:00
smu_helper.h drm/amd/pm/smu7: Remove non-functional SMU7 voltage dependency on DAL 2026-03-30 16:48:11 -04:00
smu7_baco.c drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
smu7_baco.h drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
smu7_clockpowergating.c drm/amdgpu: Remove powerdown_uvd member 2025-03-05 10:44:37 -05:00
smu7_clockpowergating.h drm/amdgpu: Remove powerdown_uvd member 2025-03-05 10:44:37 -05:00
smu7_dyn_defaults.h
smu7_hwmgr.c drm/amd/pm: smu7: Remove stale error check in smu7_hwmgr_backend_init 2026-04-17 14:49:54 -04:00
smu7_hwmgr.h drm/amd/pm/smu7: Add SCLK cap for quirky Hawaii board 2026-03-30 16:49:01 -04:00
smu7_powertune.c drm/amdgpu: Clean up errors in smu7_powertune.c 2023-08-09 09:40:40 -04:00
smu7_powertune.h
smu7_thermal.c drm/amd/pm: Prevent division by zero 2025-03-26 17:41:43 -04:00
smu7_thermal.h drm/amd/pm: drop the unnecessary intermediate percent-based transition 2021-08-16 15:35:56 -04:00
smu8_hwmgr.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smu8_hwmgr.h
smu9_baco.c drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
smu9_baco.h drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
smu10_hwmgr.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
smu10_hwmgr.h drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by 2023-10-05 11:29:03 +02:00
smu10_inc.h
tonga_baco.c drm/amd/pm: Clean up errors in tonga_baco.c 2023-08-09 09:41:10 -04:00
tonga_baco.h
vega10_baco.c drm/amd/pm: Clean up errors in vega10_baco.c 2023-08-09 09:40:22 -04:00
vega10_baco.h
vega10_hwmgr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vega10_hwmgr.h
vega10_inc.h
vega10_powertune.c drm/amd/pm: Fix an error handling path in vega10_enable_se_edc_force_stall_config() 2024-12-10 10:26:47 -05:00
vega10_powertune.h
vega10_pptable.h drm/amd: Fix UBSAN array-index-out-of-bounds for Powerplay headers 2023-11-03 11:59:51 -04:00
vega10_processpptables.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
vega10_processpptables.h
vega10_thermal.c drm/amd/pm: Prevent division by zero 2025-03-26 17:41:37 -04:00
vega10_thermal.h drm/amd/pm: drop the unnecessary intermediate percent-based transition 2021-08-16 15:35:56 -04:00
vega12_baco.c drm/amd/pm: Clean up errors in vega12_baco.c 2023-08-09 09:40:38 -04:00
vega12_baco.h
vega12_hwmgr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vega12_hwmgr.h drm/amd/pm: Clean up errors in vega12_hwmgr.h 2023-08-09 09:41:14 -04:00
vega12_inc.h
vega12_pptable.h drm/amd/pm: Clean up errors in vega12_pptable.h 2023-08-09 09:40:36 -04:00
vega12_processpptables.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vega12_processpptables.h
vega12_thermal.c drm/amd/pm: fulfill the missing enablement for vega12/vega20 L2H and H2L interrupts 2023-06-30 13:11:35 -04:00
vega12_thermal.h
vega20_baco.c drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
vega20_baco.h drm/amdgpu/pm: Add support for MACO flag checking 2024-04-09 22:07:59 -04:00
vega20_hwmgr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vega20_hwmgr.h drm/amd/pm: Clean up errors in vega20_hwmgr.h 2023-08-09 09:41:01 -04:00
vega20_inc.h
vega20_powertune.c
vega20_powertune.h
vega20_pptable.h drm/amd/pm: Clean up errors in vega20_pptable.h 2023-08-09 09:41:16 -04:00
vega20_processpptables.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vega20_processpptables.h
vega20_thermal.c drm/amd/pm: Prevent division by zero 2025-03-26 17:41:31 -04:00
vega20_thermal.h drm/amd/pm: drop the unnecessary intermediate percent-based transition 2021-08-16 15:35:56 -04:00