drm/tests/amdgpu
Geert Uytterhoeven 6a961ca843 amdgpu: Use PRI?64 to format uint64_t
On 32-bit:

    ../tests/amdgpu/amdgpu_stress.c: In function ‘alloc_bo’:
    ../tests/amdgpu/amdgpu_stress.c:178:49: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n",
                                                   ~~^
                                                   %llx
       num_buffers++, addr, domain, size);
                      ~~~~
    ../tests/amdgpu/amdgpu_stress.c:178:72: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Allocated BO number %u at 0x%lx, domain 0x%x, size %lu\n",
                                                                          ~~^
                                                                          %llu
       num_buffers++, addr, domain, size);
                                    ~~~~
    ../tests/amdgpu/amdgpu_stress.c: In function ‘submit_ib’:
    ../tests/amdgpu/amdgpu_stress.c:276:54: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                        ~~^
                                                        %llx
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                    ~~~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:65: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                   ~~^
                                                                   %llx
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                       ~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:70: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                        ~~^
                                                                        %llu
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                                    ~~~~~~
    ../tests/amdgpu/amdgpu_stress.c:276:85: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
      fprintf(stdout, "Submitted %u IBs to copy from %u(%lx) to %u(%lx) %lu bytes took %lu usec\n",
                                                                                       ~~^
                                                                                       %llu
       count, from, virtual[from], to, virtual[to], copied, delta / 1000);
                                                            ~~~~~~~~~~~~
    ../tests/amdgpu/amdgpu_stress.c: In function ‘parse_size’:
    ../tests/amdgpu/amdgpu_stress.c:296:24: warning: format ‘%li’ expects argument of type ‘long int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long long unsigned int *’} [-Wformat=]
      if (sscanf(optarg, "%li%1[kmgKMG]", &size, ext) < 1) {
                          ~~^             ~~~~~
                          %lli
    ../tests/amdgpu/amdgpu_stress.c: In function ‘main’:
    ../tests/amdgpu/amdgpu_stress.c:378:45: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Wformat=]
         fprintf(stderr, "Buffer size to small %lu\n", size);
                                               ~~^     ~~~~
                                               %llu

Fix this by using the proper "PRI?64" format specifiers.

Fixes: d77ccdf3ba ("amdgpu: add amdgpu_stress utility v2")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
---
On Linux/amd64, the format strings in the resulting binary are
unchanged.

v3:
  - Add Reviewed-by,

v2:
  - Use PRI?64 to unbreak 64-bit build.
2023-09-04 09:31:55 +02:00
..
.editorconfig amdgpu: Symlink .editorconfig to tests/amdgpu 2018-01-18 10:12:37 +01:00
amdgpu_stress.c amdgpu: Use PRI?64 to format uint64_t 2023-09-04 09:31:55 +02:00
amdgpu_test.c tests/amdgpu: Allow to exclude a test or a suite of tests 2023-03-24 13:47:21 +00:00
amdgpu_test.h tests/amdgpu: refactor dispatch/draw test 2022-08-15 06:10:15 +00:00
basic_tests.c tests/amdgpu: use AMDGPU_TIMEOUT_INFINITE to query fence 2022-11-09 14:57:14 +08:00
bo_tests.c drm/tests/amdgpu: fix Metadata test failed issue 2021-04-01 11:41:49 -04:00
cp_dma_tests.c tests/amdgpu: use appropriate ring for different asics 2022-05-26 21:02:33 +08:00
cs_tests.c tests/amdgpu:retire asic_id check on unsupported cases 2021-04-12 17:46:31 +08:00
deadlock_tests.c tests/amdgpu: add sdma slow copy linear hang test 2022-08-15 06:10:15 +00:00
decode_messages.h tests/amdgpu: add jpeg tests support 2021-12-09 19:31:45 -05:00
frame.h tests/amdgpu: add uvd encode unit tests 2017-08-16 16:16:50 -04:00
hotunplug_tests.c test/amdgpu/hotunplug: add apu check for hotplug test 2023-03-17 17:24:14 +00:00
jpeg_tests.c tests/amdgpu/jpeg: enable unit test for jpeg 4 2022-11-11 09:57:01 -05:00
meson.build tests/amdgpu: refactor dispatch/draw test 2022-08-15 06:10:15 +00:00
ras_tests.c tests/amdgpu: Fix buffer overflow (v3) 2020-01-08 13:21:40 -05:00
security_tests.c use standard `__typeof__()` instead of GNU extension `typeof()` 2022-01-19 16:08:31 -08:00
shader_code.h tests/amdgpu: add dispatch/draw test for gfx11 2022-08-15 06:10:15 +00:00
shader_code_gfx9.h tests/amdgpu: refactor dispatch/draw test 2022-08-15 06:10:15 +00:00
shader_code_gfx10.h tests/amdgpu: refactor dispatch/draw test 2022-08-15 06:10:15 +00:00
shader_code_gfx11.h tests/amdgpu: add dispatch/draw test for gfx11 2022-08-15 06:10:15 +00:00
shader_code_hang.h tests/amdgpu: refactor dispatch/draw test 2022-08-15 06:10:15 +00:00
shader_test_util.c tests/amdgpu: add dispatch/draw test for gfx11 2022-08-15 06:10:15 +00:00
syncobj_tests.c test/amdgpu: Add emit mem sync flag for test IB 2021-04-19 14:04:22 +08:00
uvd_enc_tests.c meson,configure: include config.h automatically 2018-03-20 18:19:26 +00:00
uve_ib.h tests/amdgpu: fix uvd enc data corruption issue 2017-10-06 09:40:06 -04:00
vce_ib.h tests/amdgpu: add vce mv tests support and sets 2018-04-06 09:35:14 -04:00
vce_tests.c tests/amdgpu/vcn:vcn encoder unit test 2022-06-11 12:13:26 -04:00
vcn_tests.c tests/amdgpu/vcn: fix session buffer issue for vcn1-vcn3 2023-07-17 08:40:11 -04:00
vm_tests.c tests/amdgpu:retire asic_id check on unsupported cases 2021-04-12 17:46:31 +08:00