amdgpu/pm: replaced snprintf usage in amdgpu_pm.c with sysfs_emit
authorDarren Powell <darren.powell@amd.com>
Wed, 16 Jun 2021 04:12:19 +0000 (00:12 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 18 Jun 2021 21:11:28 +0000 (17:11 -0400)
commit09b6744cc629d1fc1526b65b1585a1603d62ce7d
treee3d782eb0aa5aa1413a927e00a145ad985b4fee5
parentc9cfbf7f44bf17001f597360c8b642ae3ec91bfc
amdgpu/pm: replaced snprintf usage in amdgpu_pm.c with sysfs_emit

 replaced snprintf usage in amdgpu_pm.c with sysfs_emit
 fixed warning on comparing int with uint32_t in amdgpu_get_pp_num_states()

== Test ==
AMDGPU_PCI_ADDR=`lspci -nn | grep "VGA\|Display" | cut -d " " -f 1`
AMDGPU_HWMON=`ls -la /sys/class/hwmon | grep $AMDGPU_PCI_ADDR | cut -d " " -f 10`
HWMON_DIR=/sys/class/hwmon/${AMDGPU_HWMON}

lspci -nn | grep "VGA\|Display"  > scnprintf.test.log
FILES="pp_num_states
pp_od_clk_voltage
pp_features
pp_dpm_sclk
pp_dpm_mclk
pp_dpm_socclk
pp_dpm_fclk
pp_dpm_vclk
pp_dpm_dclk
pp_dpm_dcefclk
pp_power_profile_mode "

for f in $FILES
do
  echo === $f === >> scnprintf.test.log
  cat $HWMON_DIR/device/$f >> scnprintf.test.log
done

Signed-off-by: Darren Powell <darren.powell@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c