Skip to content

Commit

Permalink
drm/ttm: make TTM_MAX_BO_PRIORITY unsigned
Browse files Browse the repository at this point in the history
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);
                     ^~~

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Nicolai Hähnle authored and Alex Deucher committed Feb 16, 2017
1 parent e89d5b5 commit 5187b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/drm/ttm/ttm_bo_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down

0 comments on commit 5187b6c

Please sign in to comment.