From: Mirsal Ennaime <mirsal@mirsal.fr>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: "Arve Hjønnevåg" <arve@android.com>,
"Brian Swetland" <swetland@google.com>,
devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Dan Carpenter" <dan.carpenter@oracle.com>,
"Joe Perches" <joe@perches.com>,
"Mirsal Ennaime" <mirsal@mirsal.fr>
Subject: [PATCH v2 2/3] drivers: android: binder: Fix code style
Date: Tue, 12 Mar 2013 00:26:27 +0100 [thread overview]
Message-ID: <1363044388-11409-3-git-send-email-mirsal@mirsal.fr> (raw)
In-Reply-To: <1363044388-11409-1-git-send-email-mirsal@mirsal.fr>
* Use tabs
* Remove a few "80-columns" checkpatch warnings
* Separate code paths with empty lines for readability
Signed-off-by: Mirsal Ennaime <mirsal@mirsal.fr>
---
drivers/staging/android/binder.c | 42 +++++++++++++++++++++++++-------------
1 file changed, 28 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 43f823d..4652cd8 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2927,57 +2927,69 @@ static void binder_deferred_release(struct binder_proc *proc)
{
struct binder_transaction *t;
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->files);
hlist_del(&proc->proc_node);
+
if (binder_context_mgr_node && binder_context_mgr_node->proc == proc) {
binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder_release: %d context_mgr_node gone\n",
- proc->pid);
+ "binder_release: %d context_mgr_node gone\n",
+ proc->pid);
binder_context_mgr_node = NULL;
}
threads = 0;
active_transactions = 0;
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++;
active_transactions += binder_free_thread(proc, thread);
}
+
nodes = 0;
incoming_refs = 0;
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++;
rb_erase(&node->rb_node, &proc->nodes);
incoming_refs = binder_node_release(node, incoming_refs);
}
+
outgoing_refs = 0;
while ((n = rb_first(&proc->refs_by_desc))) {
- struct binder_ref *ref = rb_entry(n, struct binder_ref,
- rb_node_desc);
+ struct binder_ref *ref;
+
+ ref = rb_entry(n, struct binder_ref, rb_node_desc);
outgoing_refs++;
binder_delete_ref(ref);
}
+
binder_release_work(&proc->todo);
binder_release_work(&proc->delivered_death);
- buffers = 0;
+ buffers = 0;
while ((n = rb_first(&proc->allocated_buffers))) {
- struct binder_buffer *buffer = rb_entry(n, struct binder_buffer,
- rb_node);
+ struct binder_buffer *buffer;
+
+ buffer = rb_entry(n, struct binder_buffer, rb_node);
+
t = buffer->transaction;
if (t) {
t->buffer = NULL;
buffer->transaction = NULL;
pr_err("release proc %d, transaction %d, not freed\n",
- proc->pid, t->debug_id);
+ proc->pid, t->debug_id);
/*BUG();*/
}
+
binder_free_buf(proc, buffer);
buffers++;
}
@@ -2987,19 +2999,21 @@ static void binder_deferred_release(struct binder_proc *proc)
page_count = 0;
if (proc->pages) {
int i;
+
for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
if (proc->pages[i]) {
void *page_addr = proc->buffer + i * PAGE_SIZE;
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder_release: %d: page %d at %p not freed\n",
- proc->pid, i,
- page_addr);
+ "binder_release: %d: page %d at %p not freed\n",
+ proc->pid, i,
+ page_addr);
unmap_kernel_range((unsigned long)page_addr,
PAGE_SIZE);
__free_page(proc->pages[i]);
page_count++;
}
}
+
kfree(proc->pages);
vfree(proc->buffer);
}
--
1.7.10.4
next prev parent reply other threads:[~2013-03-11 23:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 19:31 [PATCH 0/4] Cosmetic changes to the android binder proc release code Mirsal Ennaime
2013-03-11 19:31 ` [PATCH 1/4] drivers: android: binder: Move the node release code to a separate function Mirsal Ennaime
2013-03-11 21:46 ` Dan Carpenter
2013-03-11 19:31 ` [PATCH 2/4] drivers: android: binder: Fix code style Mirsal Ennaime
2013-03-11 21:54 ` Dan Carpenter
2013-03-11 22:27 ` mirsal
2013-03-11 19:31 ` [PATCH 3/4] drivers: android: binder: Remove excessive indentation Mirsal Ennaime
2013-03-11 20:25 ` Joe Perches
2013-03-11 20:51 ` mirsal
2013-03-11 19:31 ` [PATCH 4/4] drivers: android: binder: Fix compiler warning Mirsal Ennaime
2013-03-11 21:44 ` Dan Carpenter
2013-03-11 23:26 ` [PATCH v2 0/3] Cosmetic changes to the android binder proc release code Mirsal Ennaime
2013-03-11 23:26 ` [PATCH v2 1/3] drivers: android: binder: Move the node release code to a separate function Mirsal Ennaime
2013-03-11 23:26 ` Mirsal Ennaime [this message]
2013-03-11 23:57 ` [PATCH v2 2/3] drivers: android: binder: Fix code style Arve Hjønnevåg
2013-03-12 8:52 ` mirsal
2013-03-11 23:26 ` [PATCH v2 3/3] drivers: android: binder: Remove excessive indentation Mirsal Ennaime
2013-03-12 0:04 ` Joe Perches
2013-03-12 0:21 ` Arve Hjønnevåg
2013-03-12 0:29 ` Joe Perches
2013-03-12 9:52 ` mirsal
2013-03-12 10:41 ` [PATCH v3 0/4] Cosmetic changes to the android binder proc release code Mirsal Ennaime
2013-03-12 10:41 ` [PATCH v3 1/4] drivers: android: binder: Move the node release code to a separate function Mirsal Ennaime
2013-03-12 10:42 ` [PATCH v3 2/4] drivers: android: binder: Fix code style in binder_deferred_release Mirsal Ennaime
2013-03-12 10:42 ` [PATCH v3 3/4] drivers: android: binder: Remove excessive indentation Mirsal Ennaime
2013-03-12 10:42 ` [PATCH v3 4/4] drivers: android: binder: Use __func__ in debug messages Mirsal Ennaime
2013-03-12 10:56 ` [PATCH v3 0/4] Cosmetic changes to the android binder proc release code Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363044388-11409-3-git-send-email-mirsal@mirsal.fr \
--to=mirsal@mirsal.fr \
--cc=arve@android.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=greg@kroah.com \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swetland@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®