drm/tests
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
..
amdgpu amdgpu: Use PRI?64 to format uint64_t 2023-09-04 09:31:55 +02:00
etnaviv tests/etnaviv_2d_test: check whether the rendering is correct 2020-12-09 16:00:51 +01:00
exynos libkms: Remove libkms completely 2022-04-15 22:40:29 +00:00
modeprint tests: use drmModeGetConnectorTypeName 2022-07-02 20:13:29 +00:00
modetest modetest: use dumb buffer helpers 2022-11-02 18:46:38 +01:00
nouveau use standard `__typeof__()` instead of GNU extension `typeof()` 2022-01-19 16:08:31 -08:00
proptest tests: use drmModeGetConnectorTypeName 2022-07-02 20:13:29 +00:00
radeon Revert "Revert "libdrm: remove autotools support"" 2019-10-18 18:05:45 +01:00
tegra tests: tegra: Add VIC flip test 2022-02-23 16:06:49 +01:00
ttmtest fix various typos 2019-04-17 18:23:25 +01:00
util tests/util: Add vkms driver 2023-02-10 05:22:52 +00:00
vbltest meson: always define whether headers exist 2020-01-23 17:00:12 +00:00
Android.mk android: simplify the including rule of subdirs 2015-03-20 17:07:21 +00:00
drmdevice.c Remove unused 3rd parameter to open(2) 2022-08-23 22:43:38 +00:00
drmsl.c drmsltest: Check expected neighbours 2017-08-21 13:05:13 +01:00
hash.c tests/hash: return non-zero on failure 2015-04-05 15:33:06 +01:00
meson.build libkms: Remove libkms completely 2022-04-15 22:40:29 +00:00