drm/nouveau: swap loop order in move_notify() hook
authorBen Skeggs <bskeggs@redhat.com>
Tue, 31 Oct 2017 17:56:19 +0000 (03:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 2 Nov 2017 03:32:21 +0000 (13:32 +1000)
The conditional is the same for every mapping.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c

index 22d4b90..50b400e 100644 (file)
@@ -1219,11 +1219,13 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict,
        if (bo->destroy != nouveau_bo_del_ttm)
                return;
 
-       list_for_each_entry(vma, &nvbo->vma_list, head) {
-               if (mem && new_reg->mem_type != TTM_PL_SYSTEM &&
-                   mem->page_shift == nvbo->page) {
+       if (mem && new_reg->mem_type != TTM_PL_SYSTEM &&
+           mem->page_shift == nvbo->page) {
+               list_for_each_entry(vma, &nvbo->vma_list, head) {
                        nvkm_vm_map(vma, mem);
-               } else {
+               }
+       } else {
+               list_for_each_entry(vma, &nvbo->vma_list, head) {
                        WARN_ON(ttm_bo_wait(bo, false, false));
                        nvkm_vm_unmap(vma);
                }