From 02b29caf18b3b0f6ff7b7d0b639060893cddf930 Mon Sep 17 00:00:00 2001 From: Huang Rui Date: Wed, 15 Aug 2018 15:39:33 +0800 Subject: [PATCH] drm/ttm: remove dead codes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These codes are not used. Signed-off-by: Huang Rui Reviewed-by: Christian König Signed-off-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_bo_util.c | 5 +---- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 +------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 046a6dda690a..ba80150d1052 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -629,10 +629,7 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, return -EINVAL; if (start_page > bo->num_pages) return -EINVAL; -#if 0 - if (num_pages > 1 && !capable(CAP_SYS_ADMIN)) - return -EPERM; -#endif + (void) ttm_mem_io_lock(man, false); ret = ttm_mem_io_reserve(bo->bdev, &bo->mem); ttm_mem_io_unlock(man); diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 507be7ac1165..d594f7520b7b 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -410,13 +410,7 @@ static unsigned ttm_dma_page_pool_free(struct dma_pool *pool, unsigned nr_free, if (NUM_PAGES_TO_ALLOC < nr_free) npages_to_free = NUM_PAGES_TO_ALLOC; -#if 0 - if (nr_free > 1) { - pr_debug("%s: (%s:%d) Attempting to free %d (%d) pages\n", - pool->dev_name, pool->name, current->pid, - npages_to_free, nr_free); - } -#endif + if (use_static) pages_to_free = static_buf; else -- 2.30.2