From: Roger He Date: Tue, 21 Nov 2017 01:58:26 +0000 (+0800) Subject: drm/ttm: use NUM_PAGES_TO_ALLOC always X-Git-Tag: v4.19~1610^2~33^2~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f991c0ec2b0dd773c7e0f3f31f4b06e763229381;p=platform%2Fkernel%2Flinux-rpi3.git drm/ttm: use NUM_PAGES_TO_ALLOC always Reviewed-by: Christian König Signed-off-by: Roger He Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 8d7172e..dca4d83 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);