Skip to contentSkip to conversation

drm/amdgpu: fix warning in pr_debug

PATCH In review Alex Deucher 4 participants 4 messages Oct 26, 2021 – Oct 27, 2021

Subsystems (2)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: fix warning in pr_debug

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:52:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_tt_get_user_pages’:
drivers/gpu/drm/amd/amdgpu/amdgpu.h:35:21: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
35 | #define pr_fmt(fmt) "amdgpu: " fmt

      |                     ^~~~~~~~~~
./include/linux/dynamic_debug.h:134:15: note: in expansion of macro ‘pr_fmt’
  134 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
./include/linux/dynamic_debug.h:152:2: note: in expansion of macro ‘__dynamic_func_call’
  152 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:162:2: note: in expansion of macro ‘_dynamic_func_call’
  162 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~
./include/linux/printk.h:424:2: note: in expansion of macro ‘dynamic_pr_debug’
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:697:3: note: in expansion of macro ‘pr_debug’
  697 |   pr_debug("failed %d to get user pages 0x%llx\n", r, start);
      |   ^~~~~~~~
Fixes 702dde19d4b0e7 ("drm/amdkfd: restore userptr ignore bad address error")
Cc Philip Yang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
index ae6694f2c73d..881a91a6ab13 100644
@@ -694,7 +694,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
 				       ttm->num_pages, &gtt->range, readonly,
 				       false, NULL);
 	if (r)
-		pr_debug("failed %d to get user pages 0x%llx\n", r, start);
+		pr_debug("failed %d to get user pages 0x%lux\n", r, start);
 
 out_putmm:
 	mmput(mm);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw

Am 2021-10-26 um 11:36 a.m. schrieb Alex Deucher:

Quoted 21 lines

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:52:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_tt_get_user_pages’:
drivers/gpu/drm/amd/amdgpu/amdgpu.h:35:21: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
35 | #define pr_fmt(fmt) "amdgpu: " fmt

      |                     ^~~~~~~~~~
./include/linux/dynamic_debug.h:134:15: note: in expansion of macro ‘pr_fmt’
  134 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
./include/linux/dynamic_debug.h:152:2: note: in expansion of macro ‘__dynamic_func_call’
  152 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:162:2: note: in expansion of macro ‘_dynamic_func_call’
  162 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~
./include/linux/printk.h:424:2: note: in expansion of macro ‘dynamic_pr_debug’
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:697:3: note: in expansion of macro ‘pr_debug’
  697 |   pr_debug("failed %d to get user pages 0x%llx\n", r, start);
      |   ^~~~~~~~
Quoted 3 lines
Fixes 702dde19d4b0e7 ("drm/amdkfd: restore userptr ignore bad address error")
Cc Philip Yang <[email protected]>
Quoted 17 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
index ae6694f2c73d..881a91a6ab13 100644
@@ -694,7 +694,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
 				       ttm->num_pages, &gtt->range, readonly,
 				       false, NULL);
 	if (r)
-		pr_debug("failed %d to get user pages 0x%llx\n", r, start);
+		pr_debug("failed %d to get user pages 0x%lux\n", r, start);
 
 out_putmm:
 	mmput(mm);
#2 lore raw
In reply to Alex Deucher
Quoted 34 lines · Alex Deucher

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:52:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_tt_get_user_pages’:
drivers/gpu/drm/amd/amdgpu/amdgpu.h:35:21: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]
35 | #define pr_fmt(fmt) "amdgpu: " fmt

      |                     ^~~~~~~~~~
./include/linux/dynamic_debug.h:134:15: note: in expansion of macro ‘pr_fmt’
  134 |   func(&id, ##__VA_ARGS__);  \
      |               ^~~~~~~~~~~
./include/linux/dynamic_debug.h:152:2: note: in expansion of macro ‘__dynamic_func_call’
  152 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:162:2: note: in expansion of macro ‘_dynamic_func_call’
  162 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
      |  ^~~~~~~~~~~~~~~~~~
./include/linux/printk.h:424:2: note: in expansion of macro ‘dynamic_pr_debug’
  424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:697:3: note: in expansion of macro ‘pr_debug’
  697 |   pr_debug("failed %d to get user pages 0x%llx\n", r, start);
      |   ^~~~~~~~
Fixes 702dde19d4b0e7 ("drm/amdkfd: restore userptr ignore bad address error")
Cc Philip Yang <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
index ae6694f2c73d..881a91a6ab13 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages) · line 697

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -694,7 +694,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
                                       ttm->num_pages, &gtt->range, readonly,
                                       false, NULL);
        if (r)
-               pr_debug("failed %d to get user pages 0x%llx\n", r, start);
+               pr_debug("failed %d to get user pages 0x%lux\n", r, start);

Actually this should be 0x%lx. Will fix that up locally.

Alex

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -1
 out_putmm:
        mmput(mm);
--

2.31.1

Reviewed-by on v1 1/1
#3 lore raw
In reply to Alex Deucher

Am 26.10.21 um 17:36 schrieb Alex Deucher:

Quoted 21 lines

In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:52:
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function ‘amdgpu_ttm_tt_get_user_pages’:
drivers/gpu/drm/amd/amdgpu/amdgpu.h:35:21: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘long unsigned int’ [-Wformat=]

    35 | #define pr_fmt(fmt) "amdgpu: " fmt
       |                     ^~~~~~~~~~
./include/linux/dynamic_debug.h:134:15: note: in expansion of macro ‘pr_fmt’
   134 |   func(&id, ##__VA_ARGS__);  \
       |               ^~~~~~~~~~~
./include/linux/dynamic_debug.h:152:2: note: in expansion of macro ‘__dynamic_func_call’
   152 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
       |  ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:162:2: note: in expansion of macro ‘_dynamic_func_call’
   162 |  _dynamic_func_call(fmt, __dynamic_pr_debug,  \
       |  ^~~~~~~~~~~~~~~~~~
./include/linux/printk.h:424:2: note: in expansion of macro ‘dynamic_pr_debug’
   424 |  dynamic_pr_debug(fmt, ##__VA_ARGS__)
       |  ^~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:697:3: note: in expansion of macro ‘pr_debug’
   697 |   pr_debug("failed %d to get user pages 0x%llx\n", r, start);
       |   ^~~~~~~~
Quoted 3 lines
Fixes 702dde19d4b0e7 ("drm/amdkfd: restore userptr ignore bad address error")
Cc Philip Yang <[email protected]>
Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
index ae6694f2c73d..881a91a6ab13 100644
@@ -694,7 +694,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
  				       ttm->num_pages, &gtt->range, readonly,
  				       false, NULL);
  	if (r)
-		pr_debug("failed %d to get user pages 0x%llx\n", r, start);
+		pr_debug("failed %d to get user pages 0x%lux\n", r, start);
 
  out_putmm:
  	mmput(mm);