diff options
author | Roger He <Hongbo.He@amd.com> | 2017-11-21 09:58:26 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-05 14:37:05 -0500 |
commit | 1ee0d3d778f146b982b100ae7add0c4da9626e9a (patch) | |
tree | 2c60ecbeef56c6a0d0897307846ce222ca9f8da9 /drivers/gpu | |
parent | bf93b448b80bf71c2003659b06487879153b8b9b (diff) | |
download | linux-stable-1ee0d3d778f146b982b100ae7add0c4da9626e9a.tar.gz linux-stable-1ee0d3d778f146b982b100ae7add0c4da9626e9a.tar.bz2 linux-stable-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')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc.c | 3 |
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); |