Skip to contentSkip to conversation

drm/amd/pm: replace manual string choices with standard helpers

PATCH New Yan Zhen 1 participant 1 message Jun 18, 2025

Subsystems (3)
lore
Share & tools
lore

Yan Zhen

author
#0 lore raw

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.

---
 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
index 9ace863792d4..4c8a1fe59b4e 100644
@@ -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, bool
 
 	if (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