summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorRoger He <Hongbo.He@amd.com>2017-11-21 02:58:26 +0100
committerAlex Deucher <alexander.deucher@amd.com>2017-12-05 20:37:05 +0100
commit1ee0d3d778f146b982b100ae7add0c4da9626e9a (patch)
tree2c60ecbeef56c6a0d0897307846ce222ca9f8da9 /drivers/gpu/drm/ttm
parentdrm/amdgpu: add license to files where it was missing (diff)
downloadlinux-1ee0d3d778f146b982b100ae7add0c4da9626e9a.tar.xz
linux-1ee0d3d778f146b982b100ae7add0c4da9626e9a.zip
drm/ttm: use NUM_PAGES_TO_ALLOC always
Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Roger He <Hongbo.He@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_page_alloc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index 8d7172e8381d..dca4d8322437 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -510,8 +510,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
int r = 0;
unsigned i, j, cpages;
unsigned npages = 1 << order;
- unsigned max_cpages = min(count,
- (unsigned)(PAGE_SIZE/sizeof(struct page *)));
+ unsigned max_cpages = min(count, (unsigned)NUM_PAGES_TO_ALLOC);
/* allocate array for page caching change */
caching_array = kmalloc(max_cpages*sizeof(struct page *), GFP_KERNEL);