diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 156ddcd304c3a88ec6a75f2b94bf1da0f26da5e4..37ead6995c872b64e1f2b4cef484365688364b71 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -933,10 +933,8 @@ static int ttm_dma_pool_get_num_unused_pages(void) unsigned total = 0; mutex_lock(&_manager->lock); - list_for_each_entry(p, &_manager->pools, pools) { - if (p) - total += p->pool->npages_free; - } + list_for_each_entry(p, &_manager->pools, pools) + total += p->pool->npages_free; mutex_unlock(&_manager->lock); return total; } @@ -1031,7 +1029,7 @@ static int ttm_dma_pool_mm_shrink(struct shrinker *shrink, list_for_each_entry(p, &_manager->pools, pools) { unsigned nr_free; - if (!p && !p->dev) + if (!p->dev) continue; if (shrink_pages == 0) break;