Skip to contentSkip to conversation

staging: android: binder: remove unnecessary comment

PATCH In review SeongJae Park 3 participants 8 messages Feb 18, 2014 – Feb 19, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: android: binder: remove unnecessary comment

---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/binder.c +0 -2
index eaec1da..b23cbc9 100644
@@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	unsigned int size = _IOC_SIZE(cmd);
 	void __user *ubuf = (void __user *)arg;
 
-	/*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/
-
 	trace_binder_ioctl(cmd, arg);
 
 	ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 2/2 staging: android: binder: use stack for locally used variable

The variable binder_debugfs_dir_entry_root is declared as static global variable although it is accessed from init function only. Declare it as init function's local variable because it would be better to read and memory efficiency.

---
 drivers/staging/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/android/binder.c +1 -1
index b23cbc9..78de730 100644
@@ -49,7 +49,6 @@ static HLIST_HEAD(binder_procs);
 static HLIST_HEAD(binder_deferred_list);
 static HLIST_HEAD(binder_dead_nodes);
 
-static struct dentry *binder_debugfs_dir_entry_root;
 static struct dentry *binder_debugfs_dir_entry_proc;
 static struct binder_node *binder_context_mgr_node;
 static kuid_t binder_context_mgr_uid = INVALID_UID;
@@ -3514,6 +3513,7 @@ BINDER_DEBUG_ENTRY(transaction_log);
 
 static int __init binder_init(void)
 {
+	struct dentry *binder_debugfs_dir_entry_root;
 	int ret;
 
 	binder_deferred_workqueue = create_singlethread_workqueue("binder");
Signature · 1 line
1.8.3.2
maintainer
#2 lore raw

Re: [PATCH 2/2] staging: android: binder: use stack for locally used variable

Quoted 4 lines · SeongJae Park

The variable binder_debugfs_dir_entry_root is declared as static global variable although it is accessed from init function only. Declare it as init function's local variable because it would be better to read and memory efficiency.

Are you sure? You now just lost that pointer and it can never be freed.

Not that it ever was, but before it was obvious as to what would need to be done if the module could ever be made to be unloaded...

As it is, this code is fine, I can't take this patch.

greg k-h

#3 lore raw

Re: [PATCH 2/2] staging: android: binder: use stack for locally used variable

Hello,

Quoted 7 lines · Greg KH
Quoted 4 lines · SeongJae Park

The variable binder_debugfs_dir_entry_root is declared as static global variable although it is accessed from init function only. Declare it as init function's local variable because it would be better to read and memory efficiency.

Are you sure? You now just lost that pointer and it can never be freed.

Oops, you are right.

Quoted 5 lines

Not that it ever was, but before it was obvious as to what would need to be done if the module could ever be made to be unloaded...

As it is, this code is fine, I can't take this patch.

I agree. Thank you.

Quoted 2 lines

greg k-h

maintainer
#4 lore raw
In reply to SeongJae Park
Quoted 10 lines · SeongJae Park
---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/binder.c +0 -0
index eaec1da..b23cbc9 100644

drivers/staging/android/binder.c static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 2556

Quoted 4 lines
drivers/staging/android/binder.c +0 -1
@@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 	unsigned int size = _IOC_SIZE(cmd);
 	void __user *ubuf = (void __user *)arg;
 
-	/*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/

It's useful for debugging, I'll leave it as-is, sorry.

#5 lore raw
Quoted 14 lines · Greg KH
Quoted 13 lines · SeongJae Park
---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/binder.c +0 -0
index eaec1da..b23cbc9 100644
@@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
      unsigned int size = _IOC_SIZE(cmd);
      void __user *ubuf = (void __user *)arg;
 
Quoted 3 lines

drivers/staging/android/binder.c static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 2556

Quoted 1 line
drivers/staging/android/binder.c +0 -1
-     /*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/

It's useful for debugging, I'll leave it as-is, sorry.

Agree, thank you for quick replying.

#6 lore raw
Quoted 15 lines · SeongJae Park
Quoted 14 lines · Greg KH
Quoted 13 lines · SeongJae Park
---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/binder.c +0 -0
index eaec1da..b23cbc9 100644
@@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
      unsigned int size = _IOC_SIZE(cmd);
      void __user *ubuf = (void __user *)arg;
 
Quoted 3 lines
Quoted 3 lines

drivers/staging/android/binder.c static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 2556

Quoted 1 line
drivers/staging/android/binder.c +0 -1
-     /*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/

It's useful for debugging, I'll leave it as-is, sorry.

Or just convert pr_info to pr_debug and leave uncommented?

Signature · 2 lines
With warm regards,
Sachin
#7 lore raw
Quoted 16 lines · Sachin Kamat
Quoted 15 lines · SeongJae Park
Quoted 14 lines · Greg KH
Quoted 13 lines · SeongJae Park
---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/android/binder.c +0 -0
index eaec1da..b23cbc9 100644
@@ -2553,8 +2553,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
      unsigned int size = _IOC_SIZE(cmd);
      void __user *ubuf = (void __user *)arg;
 
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

drivers/staging/android/binder.c static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · line 2556

Quoted 1 line
drivers/staging/android/binder.c +0 -1
-     /*pr_info("binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/

It's useful for debugging, I'll leave it as-is, sorry.

Or just convert pr_info to pr_debug and leave uncommented?

Sounds much better. Thank you for suggestion.
I will send patch with your recommend again soon.

Quoted 4 lines

--
With warm regards,
Sachin