[Public]

> -----Original Message-----
> From: Ingyu Jang <[email protected]>
> Sent: Wednesday, January 14, 2026 11:38 AM
> To: [email protected]
> Cc: Feng, Kenneth <[email protected]>; Deucher, Alexander
> <[email protected]>; Ingyu Jang <[email protected]>
> Subject: [PATCH] drm/amd/pm: remove dead code in
> smu7_patch_dependency_tables_with_leakage()
>
> All smu7_patch_*() functions called in this function always return 0.
> They internally call smu7_patch_ppt_v0_with_vdd_leakage() which is a void
> function with no error paths.
>
> Remove the unnecessary return value checks that can never be true.
>

While you are at it, please make all of the patch functions void.

Alex

> Signed-off-by: Ingyu Jang <[email protected]>
> ---
>  .../drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c   | 61 ++++---------------
>  1 file changed, 12 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
> index 9b28c07282699..cabf1a5db5e61 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
> @@ -2784,55 +2784,18 @@ static int smu7_patch_cac_vddc(struct
> pp_hwmgr *hwmgr, struct phm_cac_leakage_ta
>
>  static int smu7_patch_dependency_tables_with_leakage(struct pp_hwmgr
> *hwmgr)  {
> -     int tmp;
> -
> -     tmp = smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dependency_on_sclk);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dependency_on_mclk);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dep_on_dal_pwrl);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_vddci(hwmgr, hwmgr-
> >dyn_state.vddci_dependency_on_mclk);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_vce_vddc(hwmgr, hwmgr-
> >dyn_state.vce_clock_voltage_dependency_table);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_uvd_vddc(hwmgr, hwmgr-
> >dyn_state.uvd_clock_voltage_dependency_table);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_samu_vddc(hwmgr, hwmgr-
> >dyn_state.samu_clock_voltage_dependency_table);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_acp_vddc(hwmgr, hwmgr-
> >dyn_state.acp_clock_voltage_dependency_table);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_vddc_shed_limit(hwmgr, hwmgr-
> >dyn_state.vddc_phase_shed_limits_table);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_limits_vddc(hwmgr, &hwmgr-
> >dyn_state.max_clock_voltage_on_ac);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_limits_vddc(hwmgr, &hwmgr-
> >dyn_state.max_clock_voltage_on_dc);
> -     if (tmp)
> -             return -EINVAL;
> -
> -     tmp = smu7_patch_cac_vddc(hwmgr, hwmgr-
> >dyn_state.cac_leakage_table);
> -     if (tmp)
> -             return -EINVAL;
> +     smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dependency_on_sclk);
> +     smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dependency_on_mclk);
> +     smu7_patch_vddc(hwmgr, hwmgr-
> >dyn_state.vddc_dep_on_dal_pwrl);
> +     smu7_patch_vddci(hwmgr, hwmgr-
> >dyn_state.vddci_dependency_on_mclk);
> +     smu7_patch_vce_vddc(hwmgr, hwmgr-
> >dyn_state.vce_clock_voltage_dependency_table);
> +     smu7_patch_uvd_vddc(hwmgr, hwmgr-
> >dyn_state.uvd_clock_voltage_dependency_table);
> +     smu7_patch_samu_vddc(hwmgr, hwmgr-
> >dyn_state.samu_clock_voltage_dependency_table);
> +     smu7_patch_acp_vddc(hwmgr, hwmgr-
> >dyn_state.acp_clock_voltage_dependency_table);
> +     smu7_patch_vddc_shed_limit(hwmgr, hwmgr-
> >dyn_state.vddc_phase_shed_limits_table);
> +     smu7_patch_limits_vddc(hwmgr, &hwmgr-
> >dyn_state.max_clock_voltage_on_ac);
> +     smu7_patch_limits_vddc(hwmgr, &hwmgr-
> >dyn_state.max_clock_voltage_on_dc);
> +     smu7_patch_cac_vddc(hwmgr, hwmgr-
> >dyn_state.cac_leakage_table);
>
>       return 0;
>  }
> --
> 2.34.1

Reply via email to