Commit 1ee0d3d7 authored by Roger He's avatar Roger He Committed by Alex Deucher

drm/ttm: use NUM_PAGES_TO_ALLOC always

Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarRoger He <Hongbo.He@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bf93b448
...@@ -510,8 +510,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, ...@@ -510,8 +510,7 @@ static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
int r = 0; int r = 0;
unsigned i, j, cpages; unsigned i, j, cpages;
unsigned npages = 1 << order; unsigned npages = 1 << order;
unsigned max_cpages = min(count, unsigned max_cpages = min(count, (unsigned)NUM_PAGES_TO_ALLOC);
(unsigned)(PAGE_SIZE/sizeof(struct page *)));
/* allocate array for page caching change */ /* allocate array for page caching change */
caching_array = kmalloc(max_cpages*sizeof(struct page *), GFP_KERNEL); caching_array = kmalloc(max_cpages*sizeof(struct page *), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment