Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/pm: Use str_enabled_disabled in amdgpu_pm sysfs

Coccinelle flags hand-rolled "enabled"/"disabled" strings; use the shared
str_enabled_disabled() helper from string_choices.h for npm_status and
thermal throttling logging sysfs text.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603251434.zIN2QYWn-lkp@intel.com/
Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Asad Kamal and committed by
Alex Deucher
3cfe23b6 ea56aa26

+3 -2
+3 -2
drivers/gpu/drm/amd/pm/amdgpu_pm.c
··· 33 33 #include <linux/hwmon-sysfs.h> 34 34 #include <linux/nospec.h> 35 35 #include <linux/pm_runtime.h> 36 + #include <linux/string_choices.h> 36 37 #include <asm/processor.h> 37 38 38 39 #define MAX_NUM_OF_FEATURES_PER_SUBSET 8 ··· 1593 1592 1594 1593 return sysfs_emit(buf, "%s: thermal throttling logging %s, with interval %d seconds\n", 1595 1594 adev_to_drm(adev)->unique, 1596 - atomic_read(&adev->throttling_logging_enabled) ? "enabled" : "disabled", 1595 + str_enabled_disabled(atomic_read(&adev->throttling_logging_enabled)), 1597 1596 adev->throttling_logging_rs.interval / HZ + 1); 1598 1597 } 1599 1598 ··· 2236 2235 if (r) 2237 2236 return r; 2238 2237 2239 - return sysfs_emit(buf, "%s\n", npower ? "enabled" : "disabled"); 2238 + return sysfs_emit(buf, "%s\n", str_enabled_disabled(npower)); 2240 2239 } 2241 2240 2242 2241 /**