Skip to contentSkip to conversation

drm/ttm: make TTM_MAX_BO_PRIORITY unsigned

PATCH In review Nicolai Hähnle 2 participants 2 messages Feb 14, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: make TTM_MAX_BO_PRIORITY unsigned

From: Nicolai Hähnle <[email protected]>

Fix a warning about different types in min() macro in amdgpu:

In file included from ./include/linux/list.h:8:0,
from drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:32:
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function ‘amdgpu_bo_create_restricted’:
./include/linux/kernel.h:739:16: warning: comparison of distinct pointer types lacks a cast

  (void) (&min1 == &min2);   \
                ^

./include/linux/kernel.h:742:2: note: in expansion of macro ‘__min’
__min(typeof(x), typeof(y), \
^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:434:21: note: in expansion of macro ‘min’

  bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY - 1);
                     ^~~
---
 include/drm/ttm/ttm_bo_driver.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/ttm/ttm_bo_driver.h +1 -1
index 4395db1..c3d74be 100644
@@ -42,7 +42,7 @@
 #include <linux/spinlock.h>
 #include <linux/reservation.h>
 
-#define TTM_MAX_BO_PRIORITY	16
+#define TTM_MAX_BO_PRIORITY	16U
 
 struct ttm_backend_func {
 	/**
Signature · 6 lines
2.9.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20170214122557.7705-1-nhaehnle-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by
#2 lore raw

Am 14.02.2017 um 13:25 schrieb Nicolai Hähnle:

Quoted 17 lines

From: Nicolai Hähnle <[email protected]>

Fix a warning about different types in min() macro in amdgpu:

In file included from ./include/linux/list.h:8:0,
from drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:32:
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c: In function ‘amdgpu_bo_create_restricted’:
./include/linux/kernel.h:739:16: warning: comparison of distinct pointer types lacks a cast

   (void) (&min1 == &min2);   \
                 ^
./include/linux/kernel.h:742:2: note: in expansion of macro ‘__min’
   __min(typeof(x), typeof(y),   \
   ^~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c:434:21: note: in expansion of macro ‘min’
   bo->tbo.priority = min(bo->tbo.priority, TTM_MAX_BO_PRIORITY - 1);
                      ^~~
Quoted 1 line
Quoted 9 lines
---
  include/drm/ttm/ttm_bo_driver.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/ttm/ttm_bo_driver.h +0 -0
index 4395db1..c3d74be 100644

include/drm/ttm/ttm_bo_driver.h line 48

Quoted 8 lines
include/drm/ttm/ttm_bo_driver.h +1 -1
@@ -42,7 +42,7 @@
  #include <linux/spinlock.h>
  #include <linux/reservation.h>
 
-#define TTM_MAX_BO_PRIORITY	16
+#define TTM_MAX_BO_PRIORITY	16U
 
  struct ttm_backend_func {
  	/**

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx