Re: [driver-core:debugfs_lookup_fix] [mm/damon/dbgfs] ff25f87cfc: kernel_BUG_at_lib/list_debug.c

2023-01-05 Thread SeongJae Park
On Thu, 5 Jan 2023 10:53:57 +0100 Greg Kroah-Hartman 
 wrote:

> On Wed, Jan 04, 2023 at 06:35:39PM +0000, SeongJae Park wrote:
> > Hello,
> > 
> > On Tue, 3 Jan 2023 21:16:09 +0800 kernel test robot  
> > wrote:
> > 
> > > [-- Attachment #1: Type: text/plain, Size: 7528 bytes --]
> > > 
> > > 
> > > Greeting,
> > > 
> > > FYI, we noticed kernel_BUG_at_lib/list_debug.c due to commit (built with 
> > > gcc-11):
> > 
> > Thank you for the report!
> > 
> > > 
> > > commit: ff25f87cfcfc34ebe652987f2a7beb184762785b ("mm/damon/dbgfs: fix 
> > > memory leak when using debugfs_lookup()")
> > > https://git.kernel.org/cgit/linux/kernel/git/gregkh/driver-core.git 
> > > debugfs_lookup_fix
> > 
> > The commit is for fixing a memory leak due to missed dput() call.  The patch
> > has posted originally by Greg and revised my I[1].  The revised version has
> > merged in mainline during v6.0 stabilization period (1552fd3ef7db).
> > 
> > The problematic tree (driver-core/debugfs_lookup_fix) is based on v6.2-rc2, 
> > so
> > the revised patch is already applied.  But the first version of the patch is
> > applied again on the tree[2], probably by mistake, and caused double 
> > 'dput()'.
> > 
> > So I think the commit seems needs to be reverted.
> > 
> > If there is anything I missed or wrong, please let me know.
> > 
> > [1] https://lore.kernel.org/damon/20220902191149.112434-1...@kernel.org/
> > [2] 
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=debugfs_lookup_fix&id=5167d3e8149e332204274910da1057e8f907d7d2
> 
> Yeah, this is my fault, sorry.  That branch/tree has not been looked at
> carefully in a while, I need to refresh it properly and verify it all is
> correct.  I'll drop this change as part of that work as well, sorry for
> the noise.

No problem, I'm glad to help! :)


Thanks,
SJ

> 
> greg k-h
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [driver-core:debugfs_lookup_fix] [mm/damon/dbgfs] ff25f87cfc: kernel_BUG_at_lib/list_debug.c

2023-01-04 Thread SeongJae Park
Hello,

On Tue, 3 Jan 2023 21:16:09 +0800 kernel test robot  
wrote:

> [-- Attachment #1: Type: text/plain, Size: 7528 bytes --]
> 
> 
> Greeting,
> 
> FYI, we noticed kernel_BUG_at_lib/list_debug.c due to commit (built with 
> gcc-11):

Thank you for the report!

> 
> commit: ff25f87cfcfc34ebe652987f2a7beb184762785b ("mm/damon/dbgfs: fix memory 
> leak when using debugfs_lookup()")
> https://git.kernel.org/cgit/linux/kernel/git/gregkh/driver-core.git 
> debugfs_lookup_fix

The commit is for fixing a memory leak due to missed dput() call.  The patch
has posted originally by Greg and revised my I[1].  The revised version has
merged in mainline during v6.0 stabilization period (1552fd3ef7db).

The problematic tree (driver-core/debugfs_lookup_fix) is based on v6.2-rc2, so
the revised patch is already applied.  But the first version of the patch is
applied again on the tree[2], probably by mistake, and caused double 'dput()'.

So I think the commit seems needs to be reverted.

If there is anything I missed or wrong, please let me know.

[1] https://lore.kernel.org/damon/20220902191149.112434-1...@kernel.org/
[2] 
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=debugfs_lookup_fix&id=5167d3e8149e332204274910da1057e8f907d7d2


Thanks,
SJ
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: silicom: remove BP_PROC_SUPPORT dependant code

2014-03-26 Thread SeongJae Park
Some code is hide inside #ifdef BP_PROC_SUPPORT and it never defined
anywhere. And, it made defined but not used function which calling
code was hide inside #ifdef BP_PROC_SUPPORT and caused following
build warning:

drivers/staging/silicom/bpctl_mod.c:6786:12: warning:
‘bp_proc_create’ defined but not used [-Wunused-function]
 static int bp_proc_create(void)
^

Fix the warning and remove code complexity by remove whole code
inside #ifdef BP_PROC_SUPPORT.

Signed-off-by: SeongJae Park 
---
 drivers/staging/silicom/bpctl_mod.c | 39 -
 1 file changed, 39 deletions(-)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 6b9365b..530d621 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -119,7 +119,6 @@ static void if_scan_init(void);
 
 static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block);
 static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block);
-static int bp_proc_create(void);
 
 static int is_bypass_fn(struct bpctl_dev *pbpctl_dev);
 static int get_dev_idx_bsf(int bus, int slot, int func);
@@ -6399,25 +6398,6 @@ static int __init bypass_init_module(void)
}
 
register_netdevice_notifier(&bp_notifier_block);
-#ifdef BP_PROC_SUPPORT
-   {
-   int i = 0;
-   /* unsigned long flags; */
-   /* rcu_read_lock(); */
-   bp_proc_create();
-   for (i = 0; i < device_num; i++) {
-   if (bpctl_dev_arr[i].ifindex) {
-   /* spin_lock_irqsave(&bpvm_lock, flags); */
-   bypass_proc_remove_dev_sd(&bpctl_dev_arr[i]);
-   bypass_proc_create_dev_sd(&bpctl_dev_arr[i]);
-   /* spin_unlock_irqrestore(&bpvm_lock, flags); */
-   }
-
-   }
-   /* rcu_read_unlock(); */
-   }
-#endif
-
return 0;
 }
 
@@ -6431,13 +6411,6 @@ static void __exit bypass_cleanup_module(void)
 
for (i = 0; i < device_num; i++) {
/* unsigned long flags; */
-#ifdef BP_PROC_SUPPORT
-/* spin_lock_irqsave(&bpvm_lock, flags);
-   rcu_read_lock(); */
-   bypass_proc_remove_dev_sd(&bpctl_dev_arr[i]);
-/* spin_unlock_irqrestore(&bpvm_lock, flags);
-   rcu_read_unlock(); */
-#endif
remove_bypass_wd_auto(&bpctl_dev_arr[i]);
bpctl_dev_arr[i].reset_time = 0;
 
@@ -6783,18 +6756,6 @@ EXPORT_SYMBOL(bp_if_scan_sd);
 
 static struct proc_dir_entry *bp_procfs_dir;
 
-static int bp_proc_create(void)
-{
-   bp_procfs_dir = proc_mkdir(BP_PROC_DIR, init_net.proc_net);
-   if (bp_procfs_dir == (struct proc_dir_entry *)0) {
-   printk(KERN_DEBUG
-  "Could not create procfs nicinfo directory %s\n",
-  BP_PROC_DIR);
-   return -1;
-   }
-   return 0;
-}
-
 static int procfs_add(char *proc_name, const struct file_operations *fops,
  struct bpctl_dev *dev)
 {
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: silicom: hide conditionally used function in condition

2014-03-26 Thread SeongJae Park
On Wed, Mar 26, 2014 at 9:27 PM, Greg KH  wrote:
> On Wed, Mar 26, 2014 at 02:58:50PM +0900, SeongJae Park wrote:
>> bp_proc_create() be called only when BP_PROC_SUPPORT defined but its
>> definition live outside of #ifdef BP_PROC_SUPPORT and cause following
>> trivial build warning:
>> drivers/staging/silicom/bpctl_mod.c:6786:12: warning:
>> ‘bp_proc_create’ defined but not used [-Wunused-function]
>>  static int bp_proc_create(void)
>> ^
>>
>> Fix the warning by hide the definition inside #ifdef BP_PROC_SUPPORT.
>
> But no one can define that value, so why add more usages, it should just
> be ripped out.  Just remove everything "hidden" by this option as no
> one is obviously using it, and no driver should be messing around in
> /proc anyway.

Good point. I also thought in that way but hesitated big change.
Maybe I should be more brave and patient.
I will make and send patch with your opinion again in couple of hours.

Thanks.

>
> thanks,
>
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: silicom: hide conditionally used function in condition

2014-03-25 Thread SeongJae Park
bp_proc_create() be called only when BP_PROC_SUPPORT defined but its
definition live outside of #ifdef BP_PROC_SUPPORT and cause following
trivial build warning:
drivers/staging/silicom/bpctl_mod.c:6786:12: warning:
‘bp_proc_create’ defined but not used [-Wunused-function]
 static int bp_proc_create(void)
^

Fix the warning by hide the definition inside #ifdef BP_PROC_SUPPORT.

Signed-off-by: SeongJae Park 
---
 drivers/staging/silicom/bpctl_mod.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/silicom/bpctl_mod.c 
b/drivers/staging/silicom/bpctl_mod.c
index 6b9365b..beff280 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -119,7 +119,9 @@ static void if_scan_init(void);
 
 static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block);
 static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block);
+#ifdef BP_PROC_SUPPORT
 static int bp_proc_create(void);
+#endif
 
 static int is_bypass_fn(struct bpctl_dev *pbpctl_dev);
 static int get_dev_idx_bsf(int bus, int slot, int func);
@@ -6783,6 +6785,7 @@ EXPORT_SYMBOL(bp_if_scan_sd);
 
 static struct proc_dir_entry *bp_procfs_dir;
 
+#ifdef BP_PROC_SUPPORT
 static int bp_proc_create(void)
 {
bp_procfs_dir = proc_mkdir(BP_PROC_DIR, init_net.proc_net);
@@ -6794,6 +6797,7 @@ static int bp_proc_create(void)
}
return 0;
 }
+#endif
 
 static int procfs_add(char *proc_name, const struct file_operations *fops,
  struct bpctl_dev *dev)
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: android: binder: convert commented messages to pr_debug

2014-02-18 Thread SeongJae Park
Add de...@driverdev.osuosl.org as CC. Sorry if this duplicated mail
bothered your inbox.

On Wed, Feb 19, 2014 at 12:49 PM, SeongJae Park  wrote:
> 2 debugging messages were just commented out for normal case. Let them
> be activated on debug mode without explicit code modification.
>
> Signed-off-by: SeongJae Park 
> ---
>  drivers/staging/android/binder.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/android/binder.c 
> b/drivers/staging/android/binder.c
> index eaec1da..a56f941 100644
> --- a/drivers/staging/android/binder.c
> +++ b/drivers/staging/android/binder.c
> @@ -2553,7 +2553,8 @@ 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);*/
> +   pr_debug("binder_ioctl: %d:%d %x %lx\n",
> +proc->pid, current->pid, cmd, arg);
>
> trace_binder_ioctl(cmd, arg);
>
> @@ -2787,8 +2788,8 @@ static int binder_mmap(struct file *filp, struct 
> vm_area_struct *vma)
> proc->vma = vma;
> proc->vma_vm_mm = vma->vm_mm;
>
> -   /*pr_info("binder_mmap: %d %lx-%lx maps %p\n",
> -proc->pid, vma->vm_start, vma->vm_end, proc->buffer);*/
> +   pr_debug("binder_mmap: %d %lx-%lx maps %p\n",
> +proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
> return 0;
>
>  err_alloc_small_buf_failed:
> --
> 1.8.3.2
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment

2014-02-18 Thread SeongJae Park
On Wed, Feb 19, 2014 at 12:04 PM, Sachin Kamat  wrote:
> On 19 February 2014 05:58, SeongJae Park  wrote:
>> On Wed, Feb 19, 2014 at 2:07 AM, Greg KH  wrote:
>>> On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
>>>> Signed-off-by: SeongJae Park 
>>>> ---
>>>>  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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2014-02-18 Thread SeongJae Park
Hello,

On Wed, Feb 19, 2014 at 2:07 AM, Greg KH  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
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: android: binder: remove unnecessary comment

2014-02-18 Thread SeongJae Park
On Wed, Feb 19, 2014 at 2:07 AM, Greg KH  wrote:
> On Tue, Feb 18, 2014 at 08:23:25PM +0900, SeongJae Park wrote:
>> Signed-off-by: SeongJae Park 
>> ---
>>  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.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2014-02-18 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 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

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


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

2014-02-18 Thread 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 
---
 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

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] staging: android: remove unused constant, BINDER_SET_IDLE_PRIORITY

2014-02-11 Thread SeongJae Park
On Wed, Feb 12, 2014 at 5:22 AM, Greg KH  wrote:
> On Sat, Feb 08, 2014 at 11:59:41AM +0900, SeongJae Park wrote:
>> Remove constant BINDER_SET_IDLE_PRIORITY because it is not used from
>> anywhere.
>
>>
>> Signed-off-by: SeongJae Park 
>> ---
>>  drivers/staging/android/binder.h | 7 +++
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/android/binder.h 
>> b/drivers/staging/android/binder.h
>> index c4c1ed6..6d08e61 100644
>> --- a/drivers/staging/android/binder.h
>> +++ b/drivers/staging/android/binder.h
>> @@ -87,10 +87,9 @@ struct binder_version {
>>  #define BINDER_WRITE_READ_IOWR('b', 1, struct binder_write_read)
>>  #define BINDER_SET_IDLE_TIMEOUT  _IOW('b', 3, __s64)
>>  #define BINDER_SET_MAX_THREADS   _IOW('b', 5, __u32)
>> -#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
>> -#define BINDER_SET_CONTEXT_MGR   _IOW('b', 7, __s32)
>> -#define BINDER_THREAD_EXIT   _IOW('b', 8, __s32)
>> -#define BINDER_VERSION   _IOWR('b', 9, struct 
>> binder_version)
>> +#define BINDER_SET_CONTEXT_MGR   _IOW('b', 6, __s32)
>> +#define BINDER_THREAD_EXIT   _IOW('b', 7, __s32)
>> +#define BINDER_VERSION   _IOWR('b', 8, struct 
>> binder_version)
>
> And you just broke all userspace code that uses this interface :(
>
> Please be more careful, and test your patches properly.

Definitely my fault... Sorry.
I will be more careful and will not do such mistake again.

>
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: android: binder: use whitespace consistently

2014-02-07 Thread SeongJae Park
Whitespace between #define keyword and BINDER_* constants are space in
some point and tab in some point. Using space or tab is just writer's
choice. But, let's use them more consistently.

Signed-off-by: SeongJae Park 
---
 drivers/staging/android/binder.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
index cbe34516..c4c1ed6 100644
--- a/drivers/staging/android/binder.h
+++ b/drivers/staging/android/binder.h
@@ -85,11 +85,11 @@ struct binder_version {
 #define BINDER_CURRENT_PROTOCOL_VERSION 7
 
 #define BINDER_WRITE_READ  _IOWR('b', 1, struct binder_write_read)
-#defineBINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
-#defineBINDER_SET_MAX_THREADS  _IOW('b', 5, __u32)
-#defineBINDER_SET_IDLE_PRIORITY_IOW('b', 6, __s32)
-#defineBINDER_SET_CONTEXT_MGR  _IOW('b', 7, __s32)
-#defineBINDER_THREAD_EXIT  _IOW('b', 8, __s32)
+#define BINDER_SET_IDLE_TIMEOUT_IOW('b', 3, __s64)
+#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
+#define BINDER_SET_IDLE_PRIORITY   _IOW('b', 6, __s32)
+#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
+#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
 #define BINDER_VERSION _IOWR('b', 9, struct binder_version)
 
 /*
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: android: remove unused constant, BINDER_SET_IDLE_PRIORITY

2014-02-07 Thread SeongJae Park
Remove constant BINDER_SET_IDLE_PRIORITY because it is not used from
anywhere.

Signed-off-by: SeongJae Park 
---
 drivers/staging/android/binder.h | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
index c4c1ed6..6d08e61 100644
--- a/drivers/staging/android/binder.h
+++ b/drivers/staging/android/binder.h
@@ -87,10 +87,9 @@ struct binder_version {
 #define BINDER_WRITE_READ  _IOWR('b', 1, struct binder_write_read)
 #define BINDER_SET_IDLE_TIMEOUT_IOW('b', 3, __s64)
 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
-#define BINDER_SET_IDLE_PRIORITY   _IOW('b', 6, __s32)
-#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
-#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
-#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
+#define BINDER_SET_CONTEXT_MGR _IOW('b', 6, __s32)
+#define BINDER_THREAD_EXIT _IOW('b', 7, __s32)
+#define BINDER_VERSION _IOWR('b', 8, struct binder_version)
 
 /*
  * NOTE: Two special error codes you should check for when calling
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: bcm: fix pointer-integer size mismatch warnings

2014-02-04 Thread SeongJae Park
On Tue, Feb 4, 2014 at 5:51 PM, Dan Carpenter  wrote:
> On Tue, Feb 04, 2014 at 05:26:57PM +0900, SeongJae Park wrote:
>> Hello,
>>
>> On Tue, Feb 4, 2014 at 5:21 PM, Dan Carpenter  
>> wrote:
>> > On Tue, Feb 04, 2014 at 03:59:23PM +0900, SeongJae Park wrote:
>> >> Fix the pointer-integer size mismatch warnings below:
>> >>   drivers/staging/bcm/CmHost.c: In function 
>> >> ‘StoreCmControlResponseMessage’:
>> >>   drivers/staging/bcm/CmHost.c:1387:39: warning: cast to pointer from
>> >>   integer of different size [-Wint-to-pointer-cast]
>> >> pstAddIndication->psfAuthorizedSet = (struct 
>> >> bcm_connect_mgr_params *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
>> >>  ^
>> >>   drivers/staging/bcm/CmHost.c:1426:37: warning: cast to pointer from
>> >>   integer of different size [-Wint-to-pointer-cast]
>> >> pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params 
>> >> *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
>> >>^
>> >>   drivers/staging/bcm/CmHost.c:1440:35: warning: cast to pointer from
>> >>   integer of different size [-Wint-to-pointer-cast]
>> >> pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params 
>> >> *)ntohl((ULONG)pstAddIndication->psfActiveSet);
>> >>  ^
>> >
>> > No.  You haven't fixed the bug, you've just silenced the warning so now
>> > someone has to spent hours and hours looking for it when it comes time
>> > to write a proper fix.  Don't do that.
>> >
>>
>> I had thought silencing warning may be better in someway for some people.
>> But, anyway, now I agree and respect your opinion. Thank you for the opinion 
>> :)
>
> Don't worry about it.  You're not the first person to try submit that
> patch.
>
> When I last looked at it, this driver only worked under 32 bits and
> there were other 64 bit bugs as well besides this one.
>
> regards,
> dan carpenter
>

Thank you very much for your kind reply. I'm yet newbie to kernel community
and thinking I should try with unavoidable mistakes. Your reply have gave me
more courage for trial.
I will not forget the learning I got from this trial :)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: cxt1e1: remove unnecessary function, VMETRO_TRACE

2014-02-04 Thread SeongJae Park
VMETRO_TRACE isn't called from anywhere. So delete it.

Signed-off-by: SeongJae Park 
---
 drivers/staging/cxt1e1/functions.c | 9 -
 drivers/staging/cxt1e1/pmcc4.h | 1 -
 2 files changed, 10 deletions(-)

diff --git a/drivers/staging/cxt1e1/functions.c 
b/drivers/staging/cxt1e1/functions.c
index 95218e2..f5ce852 100644
--- a/drivers/staging/cxt1e1/functions.c
+++ b/drivers/staging/cxt1e1/functions.c
@@ -263,15 +263,6 @@ void sd_recv_consume(void *token, size_t len, void *user)
 
 extern ci_t *CI;/* dummy pointer to board ZERO's data */
 void
-VMETRO_TRACE (void *x)
-{
-u_int32_t   y = (u_int32_t) x;
-
-pci_write_32 ((u_int32_t *) &CI->cpldbase->leds, y);
-}
-
-
-void
 VMETRO_TRIGGER (ci_t *ci, int x)
 {
 struct s_comet_reg*comet;
diff --git a/drivers/staging/cxt1e1/pmcc4.h b/drivers/staging/cxt1e1/pmcc4.h
index 003eb86..b4b5e5a 100644
--- a/drivers/staging/cxt1e1/pmcc4.h
+++ b/drivers/staging/cxt1e1/pmcc4.h
@@ -96,7 +96,6 @@ voidsbeid_set_bdtype (ci_t *ci);
 voidsbeid_set_hdwbid (ci_t *ci);
 u_int32_t   sbeCrc (u_int8_t *, u_int32_t, u_int32_t, u_int32_t *);
 
-voidVMETRO_TRACE (void *);   /* put data into 8 LEDs */
 voidVMETRO_TRIGGER (ci_t *, int);   /* Note: int = 0(default)
  * thru 15 */
 
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: cxt1e1: fix pointer-integer size mismatch warning

2014-02-04 Thread SeongJae Park
On Tue, Feb 4, 2014 at 5:23 PM, Dan Carpenter  wrote:
> On Tue, Feb 04, 2014 at 04:01:26PM +0900, SeongJae Park wrote:
>> Fix the pointer-integer size mismatch warning below:
>>   drivers/staging/cxt1e1/functions.c: In function ‘VMETRO_TRACE’:
>>   drivers/staging/cxt1e1/functions.c:268:21: warning: cast from pointer
>>   to integer of different size [-Wpointer-to-int-cast]
>>u_int32_t   y = (u_int32_t) x;
>>^
>
> This function isn't called.  Just delete it from here and also from the
> .h file.
>

Nice review. Thank you for reviewing. I will upload new patch soon.

> regards,
> dan carpenter
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: bcm: fix pointer-integer size mismatch warnings

2014-02-04 Thread SeongJae Park
Hello,

On Tue, Feb 4, 2014 at 5:21 PM, Dan Carpenter  wrote:
> On Tue, Feb 04, 2014 at 03:59:23PM +0900, SeongJae Park wrote:
>> Fix the pointer-integer size mismatch warnings below:
>>   drivers/staging/bcm/CmHost.c: In function 
>> ‘StoreCmControlResponseMessage’:
>>   drivers/staging/bcm/CmHost.c:1387:39: warning: cast to pointer from
>>   integer of different size [-Wint-to-pointer-cast]
>> pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params 
>> *)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
>>  ^
>>   drivers/staging/bcm/CmHost.c:1426:37: warning: cast to pointer from
>>   integer of different size [-Wint-to-pointer-cast]
>> pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params 
>> *)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
>>^
>>   drivers/staging/bcm/CmHost.c:1440:35: warning: cast to pointer from
>>   integer of different size [-Wint-to-pointer-cast]
>> pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params 
>> *)ntohl((ULONG)pstAddIndication->psfActiveSet);
>>  ^
>
> No.  You haven't fixed the bug, you've just silenced the warning so now
> someone has to spent hours and hours looking for it when it comes time
> to write a proper fix.  Don't do that.
>

I had thought silencing warning may be better in someway for some people.
But, anyway, now I agree and respect your opinion. Thank you for the opinion :)

> regards,
> dan carpenter
>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: cxt1e1: fix pointer-integer size mismatch warning

2014-02-03 Thread SeongJae Park
Fix the pointer-integer size mismatch warning below:
drivers/staging/cxt1e1/functions.c: In function ‘VMETRO_TRACE’:
drivers/staging/cxt1e1/functions.c:268:21: warning: cast from pointer
to integer of different size [-Wpointer-to-int-cast]
 u_int32_t   y = (u_int32_t) x;
 ^

Signed-off-by: SeongJae Park 
---
 drivers/staging/cxt1e1/functions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/cxt1e1/functions.c 
b/drivers/staging/cxt1e1/functions.c
index 95218e2..8f19a39 100644
--- a/drivers/staging/cxt1e1/functions.c
+++ b/drivers/staging/cxt1e1/functions.c
@@ -265,7 +265,7 @@ extern ci_t *CI;/* dummy pointer to board 
ZERO's data */
 void
 VMETRO_TRACE (void *x)
 {
-u_int32_t   y = (u_int32_t) x;
+u_int32_t   y = (u_int32_t)(uintptr_t) x;
 
 pci_write_32 ((u_int32_t *) &CI->cpldbase->leds, y);
 }
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: bcm: fix pointer-integer size mismatch warnings

2014-02-03 Thread SeongJae Park
Fix the pointer-integer size mismatch warnings below:
drivers/staging/bcm/CmHost.c: In function 
‘StoreCmControlResponseMessage’:
drivers/staging/bcm/CmHost.c:1387:39: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
  pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
   ^
drivers/staging/bcm/CmHost.c:1426:37: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
  pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
 ^
drivers/staging/bcm/CmHost.c:1440:35: warning: cast to pointer from
integer of different size [-Wint-to-pointer-cast]
  pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfActiveSet);
   ^

Signed-off-by: SeongJae Park 
---
 drivers/staging/bcm/CmHost.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index cc91b5e..dd8f8f7 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -1384,7 +1384,8 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
}
 
/* this can't possibly be right */
-   pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
+   pstAddIndication->psfAuthorizedSet = (struct bcm_connect_mgr_params *)
+   (uintptr_t)ntohl((ULONG)pstAddIndication->psfAuthorizedSet);
 
if (pstAddIndicationAlt->u8Type == DSA_REQ) {
struct bcm_add_request AddRequest;
@@ -1423,7 +1424,8 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
return 0;
}
 
-   pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
+   pstAddIndication->psfAdmittedSet = (struct bcm_connect_mgr_params *)
+   (uintptr_t)ntohl((ULONG)pstAddIndication->psfAdmittedSet);
 
/* ACTIVE SET */
pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)
@@ -1437,7 +1439,8 @@ ULONG StoreCmControlResponseMessage(struct 
bcm_mini_adapter *Adapter, PVOID pvBu
return 0;
}
 
-   pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params 
*)ntohl((ULONG)pstAddIndication->psfActiveSet);
+   pstAddIndication->psfActiveSet = (struct bcm_connect_mgr_params *)
+   (uintptr_t)ntohl((ULONG)pstAddIndication->psfActiveSet);
 
(*puBufferLength) = sizeof(struct bcm_add_indication);
*(struct bcm_add_indication *)pvBuffer = *pstAddIndication;
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: crystalhd: remove unnecessary parenthesis

2014-01-17 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 drivers/staging/crystalhd/crystalhd_hw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_hw.c 
b/drivers/staging/crystalhd/crystalhd_hw.c
index ccfa3b8..4765d52 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.c
+++ b/drivers/staging/crystalhd/crystalhd_hw.c
@@ -1439,7 +1439,7 @@ static bool crystalhd_rx_list0_handler(struct 
crystalhd_hw *hw,
crystalhd_reg_wr(hw->adp, MISC1_UV_RX_ERROR_STATUS, tmp);
}
 
-   return (tmp_lsts != hw->rx_list_sts[0]);
+   return tmp_lsts != hw->rx_list_sts[0];
 }
 
 static bool crystalhd_rx_list1_handler(struct crystalhd_hw *hw,
@@ -1509,7 +1509,7 @@ static bool crystalhd_rx_list1_handler(struct 
crystalhd_hw *hw,
crystalhd_reg_wr(hw->adp, MISC1_UV_RX_ERROR_STATUS, tmp);
}
 
-   return (tmp_lsts != hw->rx_list_sts[1]);
+   return tmp_lsts != hw->rx_list_sts[1];
 }
 
 
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: crystalhd: enclose multi statements macro

2014-01-17 Thread SeongJae Park
Enclose multiple statements macro with do - while block.

Signed-off-by: SeongJae Park 
---
 drivers/staging/crystalhd/crystalhd_hw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/crystalhd/crystalhd_hw.c 
b/drivers/staging/crystalhd/crystalhd_hw.c
index 8d0680d..ccfa3b8 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.c
+++ b/drivers/staging/crystalhd/crystalhd_hw.c
@@ -433,10 +433,12 @@ static void crystalhd_rx_pkt_rel_call_back(void *context, 
void *data)
 }
 
 #define crystalhd_hw_delete_ioq(adp, q)\
+do {   \
if (q) {\
crystalhd_delete_dioq(adp, q);  \
q = NULL;   \
-   }
+   }   \
+} while (0)
 
 static void crystalhd_hw_delete_ioqs(struct crystalhd_hw *hw)
 {
-- 
1.8.3.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/3] staging: alarm-dev: Remove unnecessary blank lines

2013-11-14 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 drivers/staging/android/alarm-dev.c |3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c 
b/drivers/staging/android/alarm-dev.c
index ccf74ee..a3b467b 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -72,7 +72,6 @@ static int is_wakeup(enum android_alarm_type type)
type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP;
 }
 
-
 static void devalarm_start(struct devalarm *alrm, ktime_t exp)
 {
if (is_wakeup(alrm->type))
@@ -111,7 +110,6 @@ static void alarm_clear(enum android_alarm_type alarm_type)
}
alarm_enabled &= ~alarm_type_mask;
spin_unlock_irqrestore(&alarm_slock, flags);
-
 }
 
 static void alarm_set(enum android_alarm_type alarm_type,
@@ -371,7 +369,6 @@ static void devalarm_triggered(struct devalarm *alarm)
spin_unlock_irqrestore(&alarm_slock, flags);
 }
 
-
 static enum hrtimer_restart devalarm_hrthandler(struct hrtimer *hrt)
 {
struct devalarm *devalrm = container_of(hrt, struct devalarm, u.hrt);
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/3] staging: alarm-dev: Seperate functions with one blank line

2013-11-14 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 drivers/staging/android/alarm-dev.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/alarm-dev.c 
b/drivers/staging/android/alarm-dev.c
index a3b467b..2fc7cdd 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -278,6 +278,7 @@ static long alarm_ioctl(struct file *file, unsigned int 
cmd, unsigned long arg)
 
return 0;
 }
+
 #ifdef CONFIG_COMPAT
 static long alarm_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: alarm-dev: Remove unnecessary parenthesis

2013-11-14 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 drivers/staging/android/alarm-dev.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c 
b/drivers/staging/android/alarm-dev.c
index 647694f..ccf74ee 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -68,8 +68,8 @@ static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT];
  */
 static int is_wakeup(enum android_alarm_type type)
 {
-   return (type == ANDROID_ALARM_RTC_WAKEUP ||
-   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP);
+   return type == ANDROID_ALARM_RTC_WAKEUP ||
+   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP;
 }
 
 
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: alarm-dev: Remove unnecessary parenthesis

2013-11-14 Thread SeongJae Park
Signed-off-by: SeongJae Park 
---
 drivers/staging/android/alarm-dev.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c 
b/drivers/staging/android/alarm-dev.c
index 647694f..ccf74ee 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -68,8 +68,8 @@ static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT];
  */
 static int is_wakeup(enum android_alarm_type type)
 {
-   return (type == ANDROID_ALARM_RTC_WAKEUP ||
-   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP);
+   return type == ANDROID_ALARM_RTC_WAKEUP ||
+   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP;
 }
 
 
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel