diff options
author | Tom St Denis <tom.stdenis@amd.com> | 2018-01-25 13:52:30 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 14:18:58 -0500 |
commit | add3d95d7359e0df748baa1da57727cf334b384a (patch) | |
tree | c2c73b77505d8ac9b90dd612d044c5da3c591ab8 /drivers/gpu/drm/ttm | |
parent | c68edaa0c1ed0cfc33229a0a72c9aa76f8f80da2 (diff) | |
download | op-kernel-dev-add3d95d7359e0df748baa1da57727cf334b384a.zip op-kernel-dev-add3d95d7359e0df748baa1da57727cf334b384a.tar.gz |
drm/ttm: Simplify ttm_dma_find_pool() (v2)
Flip the logic of the comparison and remove
the redudant variable for the pool address.
(v2): Remove {} bracing.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 647eb5f..469e68e0 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -682,10 +682,10 @@ err_mem: static struct dma_pool *ttm_dma_find_pool(struct device *dev, enum pool_type type) { - struct dma_pool *pool, *tmp, *found = NULL; + struct dma_pool *pool, *tmp; if (type == IS_UNDEFINED) - return found; + return NULL; /* NB: We iterate on the 'struct dev' which has no spinlock, but * it does have a kref which we have taken. The kref is taken during @@ -698,13 +698,10 @@ static struct dma_pool *ttm_dma_find_pool(struct device *dev, * thing is at that point of time there are no pages associated with the * driver so this function will not be called. */ - list_for_each_entry_safe(pool, tmp, &dev->dma_pools, pools) { - if (pool->type != type) - continue; - found = pool; - break; - } - return found; + list_for_each_entry_safe(pool, tmp, &dev->dma_pools, pools) + if (pool->type == type) + return pool; + return NULL; } /* |