[PATCH i-g-t v4 1/9] lib/amdgpu: fixup print formatting for files in lib

vitaly prosyak vprosyak at amd.com
Tue May 27 16:29:40 UTC 2025


Hi Kamil,

Sorry for delay.

On 2025-05-27 12:09, Kamil Konieczny wrote:
> Hi Jan,
> On 2025-05-27 at 12:04:13 +0000, Jan Sokolowski wrote:
>
> one nit about subject
> imho you already have a place/file which you changed, so
> instead of:
> [PATCH i-g-t v4 1/9] lib/amdgpu: fixup print formatting for files in lib
>
> better:
> [PATCH i-g-t v4 1/9] lib/amdgpu: Fix print formatting for 32-bit compilation
>
>> Compiling on other architectures than x86-64 causes a lot
>> of print formatting warnings.
>>
>> Fix formatting by using proper formatters, eg. PRIu64.
>>
>> Cc: George Zhang <george.zhang at amd.com>
>> Cc: Vitaly Prosyak <vitaly.prosyak at amd.com>
>> Signed-off-by: Jan Sokolowski <jan.sokolowski at intel.com>
>> Reviewed-by Vitaly Prosyak <vitaly.prosyak at amd.com>
> This is missing ':' and also s/ at /@/
>
> Reviewed-by: Vitaly Prosyak <vitaly.prosyak at amd.com>
>
> Vitaly are you ok with other patch 2/9?
Yes, sure, thanks!
>
> Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
>
> Regards,
> Kamil
Regards, Vitaly
>> ---
>>  lib/amdgpu/amd_deadlock_helpers.c | 19 ++++++++++---------
>>  1 file changed, 10 insertions(+), 9 deletions(-)
>>
>> diff --git a/lib/amdgpu/amd_deadlock_helpers.c b/lib/amdgpu/amd_deadlock_helpers.c
>> index 98251061c..3b4822ca0 100644
>> --- a/lib/amdgpu/amd_deadlock_helpers.c
>> +++ b/lib/amdgpu/amd_deadlock_helpers.c
>> @@ -4,6 +4,7 @@
>>   */
>>  
>>  #include <amdgpu.h>
>> +#include <inttypes.h>
>>  #include "amdgpu_drm.h"
>>  #include "amd_PM4.h"
>>  #include "amd_sdma.h"
>> @@ -249,13 +250,13 @@ void amdgpu_wait_memory_helper(amdgpu_device_handle device_handle, unsigned int
>>  			if (support_page) {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  							0x3 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep ring: %ld and %ld enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>> +				igt_info("Disable other rings, keep ring: %" PRIu64 " and %" PRIu64 " enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>>  				ring_id++;
>>  
>>  			} else {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  							0x1 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep only ring: %ld enabled, cmd: %s\n", ring_id, cmd);
>> +				igt_info("Disable other rings, keep only ring: %" PRIu64 " enabled, cmd: %s\n", ring_id, cmd);
>>  			}
>>  			r = system(cmd);
>>  			igt_assert_eq(r, 0);
>> @@ -266,7 +267,7 @@ void amdgpu_wait_memory_helper(amdgpu_device_handle device_handle, unsigned int
>>  
>>  	/* recover the sched mask */
>>  	if (sched_mask > 1) {
>> -		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%lx > %s", sched_mask, sysfs);
>> +		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%" PRIx64 " > %s", sched_mask, sysfs);
>>  		r = system(cmd);
>>  		igt_assert_eq(r, 0);
>>  	}
>> @@ -523,12 +524,12 @@ void bad_access_ring_helper(amdgpu_device_handle device_handle, unsigned int cmd
>>  			if (support_page) {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  						0x3 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep ring: %ld and %ld enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>> +				igt_info("Disable other rings, keep ring: %" PRIu64 " and %" PRIu64 " enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>>  				ring_id++;
>>  			} else {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  						0x1 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep only ring: %ld enabled, cmd: %s\n", ring_id, cmd);
>> +				igt_info("Disable other rings, keep only ring: %" PRIu64 " enabled, cmd: %s\n", ring_id, cmd);
>>  			}
>>  
>>  			r = system(cmd);
>> @@ -540,7 +541,7 @@ void bad_access_ring_helper(amdgpu_device_handle device_handle, unsigned int cmd
>>  
>>  	/* recover the sched mask */
>>  	if (sched_mask > 1) {
>> -		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%lx > %s", sched_mask, sysfs);
>> +		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%" PRIx64 " > %s", sched_mask, sysfs);
>>  		r = system(cmd);
>>  		igt_assert_eq(r, 0);
>>  	}
>> @@ -592,12 +593,12 @@ void amdgpu_hang_sdma_ring_helper(amdgpu_device_handle device_handle, uint8_t ha
>>  			if (support_page) {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  						0x3 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep ring: %ld and %ld enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>> +				igt_info("Disable other rings, keep ring: %" PRIu64 " and %" PRIu64 " enabled, cmd: %s\n", ring_id, ring_id + 1, cmd);
>>  				ring_id++;
>>  			} else {
>>  				snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%x > %s",
>>  						0x1 << ring_id, sysfs);
>> -				igt_info("Disable other rings, keep only ring: %ld enabled, cmd: %s\n", ring_id, cmd);
>> +				igt_info("Disable other rings, keep only ring: %" PRIu64 " enabled, cmd: %s\n", ring_id, cmd);
>>  			}
>>  
>>  			r = system(cmd);
>> @@ -609,7 +610,7 @@ void amdgpu_hang_sdma_ring_helper(amdgpu_device_handle device_handle, uint8_t ha
>>  
>>  	/* recover the sched mask */
>>  	if (sched_mask > 1) {
>> -		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%lx > %s", sched_mask, sysfs);
>> +		snprintf(cmd, sizeof(cmd) - 1, "sudo echo  0x%" PRIx64 " > %s", sched_mask, sysfs);
>>  		r = system(cmd);
>>  		igt_assert_eq(r, 0);
>>  	}
>> -- 
>> 2.34.1
>>


More information about the igt-dev mailing list