drm/amd/pm: replace manual string choices with standard helpers
Subsystems (3)
PATCH 1/1 drm/amd/pm: replace manual string choices with standard helpers
Use Linux kernel-provided helper functions from <linux/string_choices.h>:
- str_enabled_disabled()
to replace manual ternary expressions like:
enable ? "enabled" : "disabled"
This improves code readability and ensures consistency with kernel coding style.
No functional change.
Signed-off-by Yan Zhen <[email protected]>
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +2 -2
@@ -25,7 +25,7 @@#include <linux/module.h> #include <linux/pci.h> #include <linux/slab.h> - +#include <linux/string_choices.h> #include "hwmgr.h" #include "amd_powerplay.h" #include "hardwaremanager.h"
@@ -3012,7 +3012,7 @@ static int vega10_enable_disable_PCC_limit_feature(struct pp_hwmgr *hwmgr, boolif (data->smu_features[GNLD_PCC_LIMIT ].supported) {if (enable == data->smu_features[GNLD_PCC_LIMIT ].enabled) -pr_info ("GNLD_PCC_LIMIT has been %s \n" , enable ?"enabled" :"disabled" ); +pr_info ("GNLD_PCC_LIMIT has been %s\n" ,str_enabled_disabled (enable)); PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr, enable, data->smu_features[GNLD_PCC_LIMIT].smu_feature_bitmap), "Attempt to Enable PCC Limit feature Failed!",
Signature · 1 line
2.34.1