From: Roger He Date: Tue, 21 Nov 2017 01:58:26 +0000 (+0800) Subject: drm/ttm: use NUM_PAGES_TO_ALLOC always X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1ee0d3d778f146b982b100ae7add0c4da9626e9a;p=openwrt%2Fstaging%2Fblogic.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 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);