Skip to contentSkip to conversation

binder: reframe comment to avoid warning

PATCH In review Ajith P V 2 participants 2 messages Nov 24, 2021 Android drivers

lore
Share & tools
lore

Ajith P V

author
#0 lore raw

PATCH 1/1 binder: reframe comment to avoid warning

binder.c file comment produce warning with checkpatch as below:
WARNING: waitqueue_active without comment

Placing the waitqueue_active comment just above waitqueue_active() avoid this warning.

---
 drivers/android/binder.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/android/binder.c +4 -2
index 49fb74196d02..e1695535f252 100644
@@ -4424,10 +4424,12 @@ static int binder_thread_release(struct binder_proc *proc,
 	/*
 	 * If this thread used poll, make sure we remove the waitqueue
 	 * from any epoll data structures holding it with POLLFREE.
-	 * waitqueue_active() is safe to use here because we're holding
-	 * the inner lock.
 	 */
 	if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
+	    /*
+	     * waitqueue_active() is safe to use here because we're holding
+	     * the inner lock.
+	     */
 	    waitqueue_active(&thread->wait)) {
 		wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
 	}
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 17 lines · Ajith P V

binder.c file comment produce warning with checkpatch as below:
WARNING: waitqueue_active without comment

Placing the waitqueue_active comment just above waitqueue_active() avoid this warning.

---
 drivers/android/binder.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/android/binder.c +0 -0
index 49fb74196d02..e1695535f252 100644
@@ -4424,10 +4424,12 @@ static int binder_thread_release(struct binder_proc *proc,
 	/*

drivers/android/binder.c static int binder_thread_release(struct binder_proc *proc, · line 4432

Quoted 10 lines
drivers/android/binder.c +4 -2
 	 * If this thread used poll, make sure we remove the waitqueue
 	 * from any epoll data structures holding it with POLLFREE.
-	 * waitqueue_active() is safe to use here because we're holding
-	 * the inner lock.
 	 */
 	if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
+	    /*
+	     * waitqueue_active() is safe to use here because we're holding
+	     * the inner lock.
+	     */

No, never comment _inside_ a if statement, that is not worth it.

checkpatch is a perl script that provides hints, there is no reason you have to always follow it exactly. :)

thanks,

greg k-h