FROMLIST: android: binder: Remove unused vma argument
authorSherry Yang <sherryy@android.com>
Sat, 16 Sep 2017 00:40:03 +0000 (20:40 -0400)
committerSherry Yang <sherryy@android.com>
Thu, 21 Sep 2017 02:27:03 +0000 (22:27 -0400)
(from https://patchwork.kernel.org/patch/9954123/)

The vma argument in update_page_range is no longer
used after 74310e06 ("android: binder: Move buffer
out of area shared with user space"), since mmap_handler
no longer calls update_page_range with a vma.

Test: ran binderLibTest, throughputtest, interfacetest and mempressure
Bug: 36007193
Change-Id: Ibd6f24c11750f8f7e6ed56e40dd18c08e02ace25
Acked-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Sherry Yang <sherryy@android.com>
drivers/android/binder_alloc.c

index 9839afa84dfdeb8399edc279a8b12557bd26c6c4..cfc3f5664015c7c90b00184871151f92d3e21169 100644 (file)
@@ -186,12 +186,12 @@ struct binder_buffer *binder_alloc_prepare_to_free(struct binder_alloc *alloc,
 }
 
 static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
-                                   void *start, void *end,
-                                   struct vm_area_struct *vma)
+                                   void *start, void *end)
 {
        void *page_addr;
        unsigned long user_page_addr;
        struct binder_lru_page *page;
+       struct vm_area_struct *vma = NULL;
        struct mm_struct *mm = NULL;
        bool need_mm = false;
 
@@ -215,7 +215,7 @@ static int binder_update_page_range(struct binder_alloc *alloc, int allocate,
                }
        }
 
-       if (!vma && need_mm)
+       if (need_mm)
                mm = get_task_mm(alloc->tsk);
 
        if (mm) {
@@ -442,7 +442,7 @@ struct binder_buffer *binder_alloc_new_buf_locked(struct binder_alloc *alloc,
        if (end_page_addr > has_page_addr)
                end_page_addr = has_page_addr;
        ret = binder_update_page_range(alloc, 1,
-           (void *)PAGE_ALIGN((uintptr_t)buffer->data), end_page_addr, NULL);
+           (void *)PAGE_ALIGN((uintptr_t)buffer->data), end_page_addr);
        if (ret)
                return ERR_PTR(ret);
 
@@ -483,7 +483,7 @@ struct binder_buffer *binder_alloc_new_buf_locked(struct binder_alloc *alloc,
 err_alloc_buf_struct_failed:
        binder_update_page_range(alloc, 0,
                                 (void *)PAGE_ALIGN((uintptr_t)buffer->data),
-                                end_page_addr, NULL);
+                                end_page_addr);
        return ERR_PTR(-ENOMEM);
 }
 
@@ -567,8 +567,7 @@ static void binder_delete_free_buffer(struct binder_alloc *alloc,
                                   alloc->pid, buffer->data,
                                   prev->data, next->data);
                binder_update_page_range(alloc, 0, buffer_start_page(buffer),
-                                        buffer_start_page(buffer) + PAGE_SIZE,
-                                        NULL);
+                                        buffer_start_page(buffer) + PAGE_SIZE);
        }
        list_del(&buffer->entry);
        kfree(buffer);
@@ -605,8 +604,7 @@ static void binder_free_buf_locked(struct binder_alloc *alloc,
 
        binder_update_page_range(alloc, 0,
                (void *)PAGE_ALIGN((uintptr_t)buffer->data),
-               (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK),
-               NULL);
+               (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK));
 
        rb_erase(&buffer->rb_node, &alloc->allocated_buffers);
        buffer->free = 1;