All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: android: binder: remove unnecessary comment
@ 2014-02-18 11:23 SeongJae Park
  2014-02-18 11:23 ` [PATCH 2/2] staging: android: binder: use stack for locally used variable SeongJae Park
  2014-02-18 17:07 ` [PATCH 1/2] staging: android: binder: remove unnecessary comment Greg KH
  0 siblings, 2 replies; 8+ messages in thread
From: SeongJae Park @ 2014-02-18 11:23 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, devel, linux-kernel, SeongJae Park

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 drivers/staging/android/binder.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index eaec1da..b23cbc9 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -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);
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] staging: android: binder: use stack for locally used variable
  2014-02-18 11:23 [PATCH 1/2] staging: android: binder: remove unnecessary comment SeongJae Park
@ 2014-02-18 11:23 ` SeongJae Park
  2014-02-18 17:07   ` Greg KH
  2014-02-18 17:07 ` [PATCH 1/2] staging: android: binder: remove unnecessary comment Greg KH
  1 sibling, 1 reply; 8+ messages in thread
From: SeongJae Park @ 2014-02-18 11:23 UTC (permalink / raw)
  To: gregkh; +Cc: swetland, devel, linux-kernel, 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.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 drivers/staging/android/binder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index b23cbc9..78de730 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -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");
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] staging: android: binder: use stack for locally used variable
  2014-02-18 11:23 ` [PATCH 2/2] staging: android: binder: use stack for locally used variable SeongJae Park
@ 2014-02-18 17:07   ` Greg KH
  2014-02-19  0:31     ` SeongJae Park
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2014-02-18 17:07 UTC (permalink / raw)
  To: SeongJae Park; +Cc: devel, swetland, linux-kernel

On Tue, Feb 18, 2014 at 08:23:26PM +0900, SeongJae Park wrote:
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment
  2014-02-18 11:23 [PATCH 1/2] staging: android: binder: remove unnecessary comment SeongJae Park
  2014-02-18 11:23 ` [PATCH 2/2] staging: android: binder: use stack for locally used variable SeongJae Park
@ 2014-02-18 17:07 ` Greg KH
  2014-02-19  0:28   ` SeongJae Park
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2014-02-18 17:07 UTC (permalink / raw)
  To: SeongJae Park; +Cc: devel, swetland, linux-kernel

On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> ---
>  drivers/staging/android/binder.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
> index eaec1da..b23cbc9 100644
> --- a/drivers/staging/android/binder.c
> +++ b/drivers/staging/android/binder.c
> @@ -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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment
  2014-02-18 17:07 ` [PATCH 1/2] staging: android: binder: remove unnecessary comment Greg KH
@ 2014-02-19  0:28   ` SeongJae Park
  2014-02-19  3:04     ` Sachin Kamat
  0 siblings, 1 reply; 8+ messages in thread
From: SeongJae Park @ 2014-02-19  0:28 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Brian Swetland, linux-kernel

On Wed, Feb 19, 2014 at 2:07 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>> ---
>>  drivers/staging/android/binder.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
>> index eaec1da..b23cbc9 100644
>> --- a/drivers/staging/android/binder.c
>> +++ b/drivers/staging/android/binder.c
>> @@ -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.

Agree, thank you for quick replying.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] staging: android: binder: use stack for locally used variable
  2014-02-18 17:07   ` Greg KH
@ 2014-02-19  0:31     ` SeongJae Park
  0 siblings, 0 replies; 8+ messages in thread
From: SeongJae Park @ 2014-02-19  0:31 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, Brian Swetland, linux-kernel

Hello,

On Wed, Feb 19, 2014 at 2:07 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Feb 18, 2014 at 08:23:26PM +0900, SeongJae Park wrote:
>> 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.

>
> 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.

>
> greg k-h

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment
  2014-02-19  0:28   ` SeongJae Park
@ 2014-02-19  3:04     ` Sachin Kamat
  2014-02-19  3:11       ` SeongJae Park
  0 siblings, 1 reply; 8+ messages in thread
From: Sachin Kamat @ 2014-02-19  3:04 UTC (permalink / raw)
  To: SeongJae Park; +Cc: Greg KH, devel, Brian Swetland, linux-kernel

On 19 February 2014 05:58, SeongJae Park <sj38.park@gmail.com> wrote:
> On Wed, Feb 19, 2014 at 2:07 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
>>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>>> ---
>>>  drivers/staging/android/binder.c | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
>>> index eaec1da..b23cbc9 100644
>>> --- a/drivers/staging/android/binder.c
>>> +++ b/drivers/staging/android/binder.c
>>> @@ -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.

Or just convert pr_info to pr_debug and leave uncommented?

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment
  2014-02-19  3:04     ` Sachin Kamat
@ 2014-02-19  3:11       ` SeongJae Park
  0 siblings, 0 replies; 8+ messages in thread
From: SeongJae Park @ 2014-02-19  3:11 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: Greg KH, devel, Brian Swetland, linux-kernel

On Wed, Feb 19, 2014 at 12:04 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> On 19 February 2014 05:58, SeongJae Park <sj38.park@gmail.com> wrote:
>> On Wed, Feb 19, 2014 at 2:07 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>> On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
>>>> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
>>>> ---
>>>>  drivers/staging/android/binder.c | 2 --
>>>>  1 file changed, 2 deletions(-)
>>>>
>>>> diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
>>>> index eaec1da..b23cbc9 100644
>>>> --- a/drivers/staging/android/binder.c
>>>> +++ b/drivers/staging/android/binder.c
>>>> @@ -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.
>
> 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.

>
> --
> With warm regards,
> Sachin

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-02-19  3:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-18 11:23 [PATCH 1/2] staging: android: binder: remove unnecessary comment SeongJae Park
2014-02-18 11:23 ` [PATCH 2/2] staging: android: binder: use stack for locally used variable SeongJae Park
2014-02-18 17:07   ` Greg KH
2014-02-19  0:31     ` SeongJae Park
2014-02-18 17:07 ` [PATCH 1/2] staging: android: binder: remove unnecessary comment Greg KH
2014-02-19  0:28   ` SeongJae Park
2014-02-19  3:04     ` Sachin Kamat
2014-02-19  3:11       ` SeongJae Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.