@@ -110,7 +110,7 @@ wrap_amdsysfs_handle * wrap_amdsysfs_create()
110
110
111
111
// search hwmon
112
112
errno = 0 ;
113
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/hwmon" , sysfsIdx);
113
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/hwmon" , sysfsIdx);
114
114
DIR* dirp = opendir (dbuf);
115
115
if (dirp == nullptr ) {
116
116
free (sysfsh);
@@ -179,7 +179,7 @@ wrap_amdsysfs_handle * wrap_amdsysfs_create()
179
179
180
180
int gpuindex = sysfsh->card_sysfs_device_id [i];
181
181
char dbuf[120 ];
182
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/uevent" , gpuindex);
182
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/uevent" , gpuindex);
183
183
std::ifstream ifs (dbuf, std::ios::binary);
184
184
std::string line;
185
185
int iBus = 0 , iDevice = 0 , iFunction = 0 ;
@@ -259,7 +259,7 @@ int wrap_amdsysfs_get_gpu_pci_id(wrap_amdsysfs_handle *sysfsh, int index, char *
259
259
return -1 ;
260
260
261
261
char dbuf[120 ];
262
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/uevent" , gpuindex);
262
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/uevent" , gpuindex);
263
263
264
264
std::ifstream ifs (dbuf, std::ios::binary);
265
265
std::string line;
@@ -287,7 +287,7 @@ int wrap_amdsysfs_get_tempC(wrap_amdsysfs_handle *sysfsh, int index, unsigned in
287
287
return -1 ;
288
288
289
289
char dbuf[120 ];
290
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/hwmon/hwmon%u /temp1_input" ,
290
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/hwmon/hwmon%d /temp1_input" ,
291
291
gpuindex, hwmonindex);
292
292
293
293
unsigned int temp = 0 ;
@@ -312,15 +312,15 @@ int wrap_amdsysfs_get_fanpcnt(wrap_amdsysfs_handle *sysfsh, int index, unsigned
312
312
unsigned int pwm = 0 , pwmMax = 255 , pwmMin = 0 ;
313
313
314
314
char dbuf[120 ];
315
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/hwmon/hwmon%u /pwm1" ,
315
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/hwmon/hwmon%d /pwm1" ,
316
316
gpuindex, hwmonindex);
317
317
getFileContentValue (dbuf, pwm);
318
318
319
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/hwmon/hwmon%u /pwm1_max" ,
319
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/hwmon/hwmon%d /pwm1_max" ,
320
320
gpuindex, hwmonindex);
321
321
getFileContentValue (dbuf, pwmMax);
322
322
323
- snprintf (dbuf, 120 , " /sys/class/drm/card%u /device/hwmon/hwmon%u /pwm1_min" ,
323
+ snprintf (dbuf, 120 , " /sys/class/drm/card%d /device/hwmon/hwmon%d /pwm1_min" ,
324
324
gpuindex, hwmonindex);
325
325
getFileContentValue (dbuf, pwmMin);
326
326
@@ -337,7 +337,7 @@ int wrap_amdsysfs_get_power_usage(wrap_amdsysfs_handle* sysfsh, int index, unsig
337
337
return -1 ;
338
338
339
339
char dbuf[120 ];
340
- snprintf (dbuf, 120 , " /sys/kernel/debug/dri/%u /amdgpu_pm_info" , gpuindex);
340
+ snprintf (dbuf, 120 , " /sys/kernel/debug/dri/%d /amdgpu_pm_info" , gpuindex);
341
341
342
342
std::ifstream ifs (dbuf, std::ios::binary);
343
343
std::string line;
0 commit comments