提交 7920aa5a 编写于 作者: D Dan Carpenter 提交者: Dave Airlie

drm/ttm: fix condition (and vs or)

The "if (!p && !p->dev)" condition isn't right because || was intended
instead of &&.  But actually, "p" is the list cursor and so it's always
non-NULL and we can just remove that bit.  We can remove the another
similar check as well.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NJerome Glisse <jglisse@redhat.com>
Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 a7eef882
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册