Commit 53413e7d authored by Mirsal Ennaime's avatar Mirsal Ennaime Committed by Greg Kroah-Hartman

drivers: android: binder: Fix code style in binder_deferred_release

 * Use tabs where applicable
 * Remove a few "80-columns" checkpatch warnings
 * Separate code paths with empty lines for readability
Signed-off-by: default avatarMirsal Ennaime <mirsal@mirsal.fr>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 008fa749
...@@ -2927,12 +2927,14 @@ static void binder_deferred_release(struct binder_proc *proc) ...@@ -2927,12 +2927,14 @@ static void binder_deferred_release(struct binder_proc *proc)
{ {
struct binder_transaction *t; struct binder_transaction *t;
struct rb_node *n; struct rb_node *n;
int threads, nodes, incoming_refs, outgoing_refs, buffers, active_transactions, page_count; int threads, nodes, incoming_refs, outgoing_refs, buffers,
active_transactions, page_count;
BUG_ON(proc->vma); BUG_ON(proc->vma);
BUG_ON(proc->files); BUG_ON(proc->files);
hlist_del(&proc->proc_node); hlist_del(&proc->proc_node);
if (binder_context_mgr_node && binder_context_mgr_node->proc == proc) { if (binder_context_mgr_node && binder_context_mgr_node->proc == proc) {
binder_debug(BINDER_DEBUG_DEAD_BINDER, binder_debug(BINDER_DEBUG_DEAD_BINDER,
"binder_release: %d context_mgr_node gone\n", "binder_release: %d context_mgr_node gone\n",
...@@ -2943,33 +2945,42 @@ static void binder_deferred_release(struct binder_proc *proc) ...@@ -2943,33 +2945,42 @@ static void binder_deferred_release(struct binder_proc *proc)
threads = 0; threads = 0;
active_transactions = 0; active_transactions = 0;
while ((n = rb_first(&proc->threads))) { while ((n = rb_first(&proc->threads))) {
struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node); struct binder_thread *thread;
thread = rb_entry(n, struct binder_thread, rb_node);
threads++; threads++;
active_transactions += binder_free_thread(proc, thread); active_transactions += binder_free_thread(proc, thread);
} }
nodes = 0; nodes = 0;
incoming_refs = 0; incoming_refs = 0;
while ((n = rb_first(&proc->nodes))) { while ((n = rb_first(&proc->nodes))) {
struct binder_node *node = rb_entry(n, struct binder_node, rb_node); struct binder_node *node;
node = rb_entry(n, struct binder_node, rb_node);
nodes++; nodes++;
rb_erase(&node->rb_node, &proc->nodes); rb_erase(&node->rb_node, &proc->nodes);
incoming_refs = binder_node_release(node, incoming_refs); incoming_refs = binder_node_release(node, incoming_refs);
} }
outgoing_refs = 0; outgoing_refs = 0;
while ((n = rb_first(&proc->refs_by_desc))) { while ((n = rb_first(&proc->refs_by_desc))) {
struct binder_ref *ref = rb_entry(n, struct binder_ref, struct binder_ref *ref;
rb_node_desc);
ref = rb_entry(n, struct binder_ref, rb_node_desc);
outgoing_refs++; outgoing_refs++;
binder_delete_ref(ref); binder_delete_ref(ref);
} }
binder_release_work(&proc->todo); binder_release_work(&proc->todo);
binder_release_work(&proc->delivered_death); binder_release_work(&proc->delivered_death);
buffers = 0;
buffers = 0;
while ((n = rb_first(&proc->allocated_buffers))) { while ((n = rb_first(&proc->allocated_buffers))) {
struct binder_buffer *buffer = rb_entry(n, struct binder_buffer, struct binder_buffer *buffer;
rb_node);
buffer = rb_entry(n, struct binder_buffer, rb_node);
t = buffer->transaction; t = buffer->transaction;
if (t) { if (t) {
t->buffer = NULL; t->buffer = NULL;
...@@ -2978,6 +2989,7 @@ static void binder_deferred_release(struct binder_proc *proc) ...@@ -2978,6 +2989,7 @@ static void binder_deferred_release(struct binder_proc *proc)
proc->pid, t->debug_id); proc->pid, t->debug_id);
/*BUG();*/ /*BUG();*/
} }
binder_free_buf(proc, buffer); binder_free_buf(proc, buffer);
buffers++; buffers++;
} }
...@@ -2987,13 +2999,13 @@ static void binder_deferred_release(struct binder_proc *proc) ...@@ -2987,13 +2999,13 @@ static void binder_deferred_release(struct binder_proc *proc)
page_count = 0; page_count = 0;
if (proc->pages) { if (proc->pages) {
int i; int i;
for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) { for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
if (proc->pages[i]) { if (proc->pages[i]) {
void *page_addr = proc->buffer + i * PAGE_SIZE; void *page_addr = proc->buffer + i * PAGE_SIZE;
binder_debug(BINDER_DEBUG_BUFFER_ALLOC, binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"binder_release: %d: page %d at %p not freed\n", "binder_release: %d: page %d at %p not freed\n",
proc->pid, i, proc->pid, i, page_addr);
page_addr);
unmap_kernel_range((unsigned long)page_addr, unmap_kernel_range((unsigned long)page_addr,
PAGE_SIZE); PAGE_SIZE);
__free_page(proc->pages[i]); __free_page(proc->pages[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment