[Public]

> -----Original Message-----
> From: Ingyu Jang <[email protected]>
> Sent: Friday, January 9, 2026 11:34 AM
> To: [email protected]
> Cc: Feng, Kenneth <[email protected]>; Deucher, Alexander
> <[email protected]>; Ingyu Jang <[email protected]>
> Subject: [Question] Dead code in
> smu7_patch_dependency_tables_with_leakage()?
>
> Hi,
>
> I noticed that in
> drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c,
> the function smu7_patch_dependency_tables_with_leakage() checks the
> return values of 12 patch functions:
>
>   - smu7_patch_vddc()
>   - smu7_patch_vddci()
>   - smu7_patch_vce_vddc()
>   - smu7_patch_uvd_vddc()
>   - smu7_patch_vddc_shed_limit()
>   - smu7_patch_samu_vddc()
>   - smu7_patch_acp_vddc()
>   - smu7_patch_limits_vddc() (called twice)
>   - smu7_patch_cac_vddc()
>
> However, all of these functions always return 0. They call
> smu7_patch_ppt_v0_with_vdd_leakage() which is a void function, and there
> are no error paths in any of the patch functions.
>
> Is this intentional defensive coding for potential future changes, or could 
> this
> be cleaned up?

I assume it was just there in case one of them could fail, but ultimately, they 
didn't.  smu7 is over 10 years old at this point, so there is no likely to be 
any changes. If you'd like to clean that up, feel free to send out patches.

Alex

Reply via email to