[PATCH 2/3] mm/shmem.c: let shmem_show_mpol() return value.

2013-08-20 Thread Chen Gang
Let shmem_show_mpol() return value, since it may fail. Signed-off-by: Chen Gang Cc: Cyrill Gorcunov --- mm/shmem.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 75010ba..e59d332 100644 --- a/mm/shmem.c +++ b/mm/shmem.c

Re: [PATCH] kernel/module.c: use scnprintf() instead of sprintf()

2013-08-20 Thread Chen Gang
On 08/20/2013 02:04 PM, Rusty Russell wrote: > Chen Gang writes: > >> For some strings, they are permitted to be larger than PAGE_SIZE, so >> need use scnprintf() instead of sprintf(), or it will cause issue. >> >> One case is: >> >> if a module

[PATCH 1/3] fs/proc/task_mmu.c: check the return value of mpol_to_str()

2013-08-20 Thread Chen Gang
mpol_to_str() may fail, and not fill the buffer (e.g. -EINVAL), so need check about it, or buffer may not be zero based, and next seq_printf() will cause issue. The failure return need after mpol_cond_put() to match get_vma_policy(). Signed-off-by: Chen Gang Cc: Cyrill Gorcunov --- fs/proc

[PATCH 3/3] mm/shmem.c: check the return value of mpol_to_str()

2013-08-20 Thread Chen Gang
mpol_to_str() may fail, and not fill the buffer (e.g. -EINVAL), so need check about it, or buffer may not be zero based, and next seq_printf() will cause issue. Signed-off-by: Chen Gang Cc: Cyrill Gorcunov --- mm/shmem.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff

Re: [PATCH] kernel/futex.c: notice the return value after rt_mutex_finish_proxy_lock() fails

2013-08-20 Thread Chen Gang
On 08/21/2013 12:19 AM, Darren Hart wrote: > HopingOn Tue, 2013-08-20 at 11:07 +0800, Chen Gang wrote: > > > Hi Chen, > >> rt_mutex_finish_proxy_lock() can return failure code (e.g. -EINTR, >> -ETIMEDOUT). >> >> Original implementation has already notic

Re: [PATCH] kernel: user_namespace: always set the return parameter 'new_cred' when call unshare_userns() successfully.

2013-08-20 Thread Chen Gang
On 08/20/2013 10:37 PM, Oleg Nesterov wrote: > On 08/20, Serge Hallyn wrote: >> >> Quoting Chen Gang (gang.c...@asianux.com): >>> When unshare_userns() succeed, recommend to always set the return >>> parameter which may be used by caller. >>> >>&

Re: [PATCH 0/3] mm: shmem: check the return value of mpol_to_str()

2013-08-20 Thread Chen Gang
On 08/21/2013 01:31 PM, Cyrill Gorcunov wrote: > On Wed, Aug 21, 2013 at 10:21:22AM +0800, Chen Gang wrote: >> mpol_to_str() may fail, and not fill the buffer (e.g. -EINVAL), so need >> check about it, or buffer may not be zero based, and next seq_printf() >> will cause issue

Re: [PATCH] kernel/rcutree.c: deem to be lazy if there are no callbacks.

2013-08-20 Thread Chen Gang
f (all_lazy) *all_lazy = al; return hc; ---diff end- Thanks. On 08/20/2013 12:45 PM, Chen Gang wrote: > On 08/20/2013 12:43 PM, Chen Gang wrote: >> On 08/20/2013 12:18 PM, Paul E. McKenney wrote: >>> On Tu

Re: [PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-21 Thread Chen Gang
have negative effect with the efficiency. 3. sometimes, I can not connect to net, which may not give response in time. e.g. recently, 2013-08-08 -- 2013-08-19, but I may still can 'work' for it (queue patches and waiting the network OK). BTW: I also can try the English-Chinese

[PATCH] mm/shmem.c: check the return value of mpol_to_str()

2013-08-21 Thread Chen Gang
mpol_to_str() may fail, and not fill the buffer (e.g. -EINVAL), so need check about it, or buffer may not be zero based, and next seq_printf() will cause issue. Also need let shmem_show_mpol() return value, since it may fail. Signed-off-by: Chen Gang Reviewed-by: Cyrill Gorcunov --- mm

Re: [PATCH 2/3] mm/shmem.c: let shmem_show_mpol() return value.

2013-08-21 Thread Chen Gang
On 08/22/2013 06:03 AM, Andrew Morton wrote: > On Wed, 21 Aug 2013 10:23:58 +0800 Chen Gang wrote: > >> Let shmem_show_mpol() return value, since it may fail. >> > > This patch has no effect. > >> --- a/mm/shmem.c >> +++ b/mm/shmem.c >> @

Re: [PATCH] kernel/delayacct.c: check NULL for member variable 'delays' in all extern functions.

2013-08-21 Thread Chen Gang
On 08/22/2013 06:10 AM, Andrew Morton wrote: > On Tue, 20 Aug 2013 10:40:03 +0800 Chen Gang wrote: > >> The member variable 'delays' may be NULL, so need check NULL before use >> it for all extern functions, just like __delayacct_tsk_init() and >> __delayacct_ad

Re: [PATCH] kernel/rcutree.c: deem to be lazy if there are no callbacks.

2013-08-21 Thread Chen Gang
On 08/21/2013 10:23 PM, Paul E. McKenney wrote: > On Wed, Aug 21, 2013 at 01:59:29PM +0800, Chen Gang wrote: >> >> If we still doubt about it, but can not find a suitable way to fix it >> (neither of us are familiar with it). > > Well, you have that halfway correct, whi

Re: [PATCH] kernel: user_namespace: always set the return parameter 'new_cred' when call unshare_userns() successfully.

2013-08-21 Thread Chen Gang
On 08/21/2013 07:57 PM, Oleg Nesterov wrote: > On 08/21, Chen Gang wrote: >> >> On 08/20/2013 10:37 PM, Oleg Nesterov wrote: >>> On 08/20, Serge Hallyn wrote: >>>> >>>> >>>> But the only existing caller (sys_unshare) does in fact initiali

Re: [PATCH] kernel/padata.c: always check the return value of __padata_remove_cpu() and __padata_add_cpu()

2013-08-21 Thread Chen Gang
On 08/22/2013 01:11 PM, Steffen Klassert wrote: > On Tue, Aug 20, 2013 at 11:44:31AM +0800, Chen Gang wrote: >> >> If this patch is correct, better to let CPU_ONLINE and CPU_DOWN_FAILED >> share the same code. >> >> And do we need a comment "/* fall thro

Re: [PATCH] kernel/padata.c: always check the return value of __padata_remove_cpu() and __padata_add_cpu()

2013-08-22 Thread Chen Gang
On 08/22/2013 02:05 PM, Steffen Klassert wrote: > On Thu, Aug 22, 2013 at 01:27:16PM +0800, Chen Gang wrote: >> On 08/22/2013 01:11 PM, Steffen Klassert wrote: >>> On Tue, Aug 20, 2013 at 11:44:31AM +0800, Chen Gang wrote: >>>> >>>> If this patc

[PATCH v2] kernel/padata.c: share code between CPU_ONLINE and CPU_DOWN_FAILED, same to CPU_DOWN_PREPARE and CPU_UP_CANCELED

2013-08-22 Thread Chen Gang
Share code between CPU_ONLINE and CPU_DOWN_FAILED, same to CPU_DOWN_PREPARE and CPU_UP_CANCELED. It will fix 2 bugs: "not check the return value of __padata_remove_cpu() and __padata_add_cpu()". "need add 'break' between CPU_UP_CANCELED and CPU_DOWN_FAILED&quo

Re: [PATCH v2] kernel/padata.c: share code between CPU_ONLINE and CPU_DOWN_FAILED, same to CPU_DOWN_PREPARE and CPU_UP_CANCELED

2013-08-22 Thread Chen Gang
On 08/22/2013 02:43 PM, Chen Gang wrote: > Share code between CPU_ONLINE and CPU_DOWN_FAILED, same to > CPU_DOWN_PREPARE and CPU_UP_CANCELED. > > It will fix 2 bugs: > > "not check the return value of __padata_remove_cpu() and > __padata_add_cpu()"

Re: [PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-23 Thread Chen Gang
r export list +# UAPI is User API which can be used by user mode. + header-y += byteorder/ header-y += can/ header-y += caif/ -- 1.7.7.6 --patch end- Thanks. On 08/21/2013 02:34 PM, Chen Gang wrote: > Hello all: > >

[PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-05 Thread Chen Gang
more explanations for "include/uapi/" in "include/uapi/Kbuild", also add more explanations for "include/uapi/linux/" in "include/uapi /linux/Kbuild". Signed-off-by: Chen Gang --- include/uapi/Kbuild |5 ++--- include/uapi/linux/Kbuild |2 ++ 2

[PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
ame value. Also modify the related code to pass "./scripts/checkpatch.pl" checking. Signed-off-by: Chen Gang --- kernel/sysctl_binary.c | 142 1 files changed, 72 insertions(+), 70 deletions(-) diff --git a/kernel/sysctl_binary.c b/ke

[PATCH 0/2] kernel/sys.c: for setfsgid(), return the current gid when error occurs

2013-08-06 Thread Chen Gang
They are 2 related patches for setfsgid(). Patch 1 for bug fix: return the current gid when error occurs. Patch 2 for cleaning code: remove useless variable 'old_fsgid'. Signed-off-by: Chen Gang -- kernel/sys.c | 15 +-- 1 files changed, 5 insertions(+), 10 deletion

[PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-06 Thread Chen Gang
ned-off-by: Chen Gang --- kernel/sys.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 771129b..9356dc8 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -775,11 +775,11 @@ SYSCALL_DEFINE1(setfsgid, gid_t, gid) kgid = mak

[PATCH 2/2] kernel/sys.c: remove useless variable 'old_fsgid' for setfsgid()

2013-08-06 Thread Chen Gang
Remove useless variable 'old_fsgid' to make code clearer for readers. Signed-off-by: Chen Gang --- kernel/sys.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 9356dc8..fc169d8 100644 --- a/kernel/sys.c +++ b/ke

kernel/sys.c: for setfsuid(), return the current uid when error occurs

2013-08-06 Thread Chen Gang
They are 2 related patches for setfsuid(). Patch 1 for bug fix: return the current uid when error occurs. Patch 2 for cleaning code: remove useless variable 'old_fsuid'. Signed-off-by: Chen Gang -- kernel/sys.c | 14 ++ 1 files changed, 6 insertions(+), 8 deletion

Re: kernel/sys.c: for setfsuid(), return the current uid when error occurs

2013-08-06 Thread Chen Gang
Please skip it, sorry for bothering you with waste information. On 08/06/2013 04:13 PM, Chen Gang wrote: > They are 2 related patches for setfsuid(). > > Patch 1 for bug fix: return the current uid when error occurs. > Patch 2 for cleaning code: remove useless variable 'old_fs

[PATCH 0/2] kernel/sys.c: for setfsuid(), return the current uid when error occurs

2013-08-06 Thread Chen Gang
They are 2 related patches for setfsuid(). Patch 1 for bug fix: return the current uid when error occurs. Patch 2 for cleaning code: remove useless variable 'old_fsuid'. Signed-off-by: Chen Gang -- kernel/sys.c | 14 ++ 1 files changed, 6 insertions(+), 8 deletions

[PATCH 1/2] kernel/sys.c: return the current uid when error occurs

2013-08-06 Thread Chen Gang
ned-off-by: Chen Gang --- kernel/sys.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 771129b..558ccdb 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -736,11 +736,11 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid) kuid = mak

[PATCH 2/2] kernel/sys.c: remove useless variable 'old_fsuid' for setfsuid()

2013-08-06 Thread Chen Gang
Remove useless variable 'old_fsuid' to make code clearer for readers. Signed-off-by: Chen Gang --- kernel/sys.c | 14 ++ 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 558ccdb..e3983b2 100644 --- a/kernel/sys.c +++ b/ke

[PATCH] kernel/sys.c: improve the usage of return value

2013-08-06 Thread Chen Gang
make code clearer and save some instructions. Also modify the related code to pass "./scripts/checkpatch.pl" checking. Signed-off-by: Chen Gang --- kernel/sys.c | 147 +++--- 1 files changed, 79 insertions(+), 68 deletions(-) di

Re: [PATCH 2/2] kernel/sys.c: remove useless variable 'old_fsuid' for setfsuid()

2013-08-06 Thread Chen Gang
On 08/06/2013 04:16 PM, Chen Gang wrote: > Remove useless variable 'old_fsuid' to make code clearer for readers. > > Signed-off-by: Chen Gang > --- > kernel/sys.c | 14 ++ > 1 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/k

Re: [PATCH 2/2] kernel/sys.c: remove useless variable 'old_fsgid' for setfsgid()

2013-08-06 Thread Chen Gang
On 08/06/2013 04:02 PM, Chen Gang wrote: > Remove useless variable 'old_fsgid' to make code clearer for readers. > > Signed-off-by: Chen Gang > --- > kernel/sys.c |9 ++--- > 1 files changed, 2 insertions(+), 7 deletions(-) > > diff --git a/kernel/sy

Re: [PATCH 0/2] kernel/sys.c: for setfsgid(), return the current gid when error occurs

2013-08-06 Thread Chen Gang
On 08/07/2013 02:36 AM, Kees Cook wrote: > On Tue, Aug 6, 2013 at 1:00 AM, Chen Gang wrote: >> They are 2 related patches for setfsgid(). >> >> Patch 1 for bug fix: return the current gid when error occurs. >> Patch 2 for cleaning code: remove useless variable '

Re: [PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-06 Thread Chen Gang
On 08/07/2013 01:31 AM, Joe Perches wrote: > On Tue, 2013-08-06 at 09:46 +0800, Chen Gang wrote: >> "include/uapi/" is the whole Linux kernel API, it is important enough >> to get more global explanations by comments. > > It'd probably be useful to hav

Re: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-06 Thread Chen Gang
On 08/07/2013 04:21 AM, Andy Lutomirski wrote: > On 08/06/2013 01:01 AM, Chen Gang wrote: >> According to the API definition, when error occurs, need return current >> fsgid instead of the previous one. >> >> The related informations ("man setfsgid"): >&g

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
On 08/07/2013 06:11 AM, Joe Perches wrote: > On Tue, 2013-08-06 at 14:43 -0700, Andrew Morton wrote: >> On Tue, 06 Aug 2013 15:29:42 +0800 Chen Gang wrote: >> >>> Improve the usage of return value 'result', so not only can make code >>> clearer to re

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
On 08/07/2013 05:46 AM, Eric W. Biederman wrote: > Chen Gang writes: > > Have you tested this code? Do you have anything that actually the > uses sysctl binary interface? > No, I only compile about it, not give a test. It is really better to give a test, but it seems not qui

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
Thank you for your reply in details, especially you are very busy. My original opinion about optimization is incorrect. Thanks. On 08/07/2013 05:43 AM, Andrew Morton wrote: > On Tue, 06 Aug 2013 15:29:42 +0800 Chen Gang wrote: > >> Improve the usage of return value 'result&

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
Do you still want to discuss with me ? if not, please put my e-mail into "/dev/null", I really can understand, and say sorry to you. Thanks. >> At least, one conclusion is: this patch switches from old-style to >> new-style, not for optimization. >> >> But for sysctl_

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
municate in english... > > I don't think that's true. > > For instance, pessimization is a pretty > obscure word. Most native English speakers > could probably guess what it meant, but I > couldn't hold any low opinion of non-native > speaker that asked "

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
On 08/07/2013 02:29 PM, Andrew Morton wrote: > On Wed, 07 Aug 2013 14:24:05 +0800 Chen Gang wrote: > >>> To be honest... >>> >>> You are too bad in english to do kernel development. You don't seem to >>> know how to communicate in english... >>

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Chen Gang
ss what it meant, but I >> couldn't hold any low opinion of non-native >> speaker that asked "what does that mean". >> > > I know, and that's why I didn't quote that part. > I guess, Joe also know about that. He intends to explain 'pessimiz

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-07 Thread Chen Gang
think what you said above is about ways (or method). For ways, it is meaningless to say which is better or bad, it depends on one's goal, one's environments, and one's resources. So, every member need think of it, and find their own suitable ways to continue providing their contributio

Re: [PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-07 Thread Chen Gang
On 08/07/2013 03:32 PM, Rob Landley wrote: > On 08/06/2013 12:31:43 PM, Joe Perches wrote: >> On Tue, 2013-08-06 at 09:46 +0800, Chen Gang wrote: >> > "include/uapi/" is the whole Linux kernel API, it is important enough >> > to get more global explanation

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-07 Thread Chen Gang
r the related details contents, he is the last one reply, not me). :-) > Please don't argue anymore... > Discussing does not mean arguing. Since we are both Chinese, one Chinese sentence is "Jun Zi He Er Bu Tong". excuse me, my English is not quite well, could you (or other

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-07 Thread Chen Gang
Firstly, sorry for replying late, and also thank you for your detail patient reply. On 08/07/2013 03:45 PM, Eric W. Biederman wrote: > Chen Gang writes: > >> On 08/07/2013 05:46 AM, Eric W. Biederman wrote: >>> Chen Gang writes: >>> >>> Have you teste

Re: [PATCH] kernel/sys.c: improve the usage of return value

2013-08-07 Thread Chen Gang
According to the related discussion in another thread, this patch can be obsoleted now. Thanks. On 08/06/2013 04:43 PM, Chen Gang wrote: > Improve the usage of return value, so not only can make code clearer > to readers, but also can improve the performance. > > Assign the retur

Re: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-07 Thread Chen Gang
all, whether succeed or not, it always return the previous value, the caller can not know whether succeed or not directly" "if the caller need know about success or not, the demo like below" " setfsuid(new);" " if (setfsuid(-1) != new)" "

Re: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-07 Thread Chen Gang
On 08/08/2013 09:35 AM, Andy Lutomirski wrote: > On Wed, Aug 7, 2013 at 6:30 PM, Chen Gang wrote: >> On 08/08/2013 12:58 AM, Andy Lutomirski wrote: >>> On Wed, Aug 7, 2013 at 9:21 AM, Oleg Nesterov wrote: >>>> On 08/06, Andy Lutomirski wrote: >>>>> &

Re: [PATCH trivial] UAPI: Kbuild: add/modify comments for "uapi/Kbuild" and "uapi/linux/Kbuild"

2013-08-07 Thread Chen Gang
still suitable to discuss about it in this mail thread, please continue, at least, I still welcome. :-) Thanks. On 08/07/2013 04:48 PM, Chen Gang wrote: > On 08/07/2013 03:32 PM, Rob Landley wrote: >> On 08/06/2013 12:31:43 PM, Joe Perches wrote: >>> On Tue, 2013-08-06 at 09:4

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-07 Thread Chen Gang
On 08/08/2013 02:38 AM, Eric W. Biederman wrote: > Chen Gang writes: > >> Firstly, sorry for replying late, and also thank you for your detail >> patient reply. >> >> On 08/07/2013 03:45 PM, Eric W. Biederman wrote: >>> Chen Gang writes: >>> >

Re: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-08 Thread Chen Gang
On 08/08/2013 09:52 PM, Michael Kerrisk (man-pages) wrote: > On 08/08/13 03:48, Chen Gang wrote: >> On 08/08/2013 09:35 AM, Andy Lutomirski wrote: >>> On Wed, Aug 7, 2013 at 6:30 PM, Chen Gang wrote: >>>> On 08/08/2013 12:58 AM, Andy Lutomirski wrote: >>>

Re: [PATCH 1/2] kernel/sys.c: return the current gid when error occurs

2013-08-08 Thread Chen Gang
g at the return value > +from a further call such as > +.IR setfsuid(\-1) > +(which will always fail), in order to determine if a preceding call to > +.BR setfsuid () > +changed the filesystem user ID. > At the very > least, > .B EPERM > Is it suitable to mention this API is obsoleted and unneeded in man page ? ;-) Thanks. -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] reiserfs: check/extend buffer length for printing functions

2013-07-18 Thread Chen Gang
On 07/18/2013 04:18 PM, Chen Gang wrote: > On 07/18/2013 03:54 PM, Chen Gang wrote: >> On 07/18/2013 03:43 PM, Al Viro wrote: >>> On Thu, Jul 18, 2013 at 03:29:17PM +0800, Chen Gang wrote: >>>>> On 07/18/2013 12:28 PM, Chen Gang wrote: >>&

[PATCH v2] reiserfs: check/extend buffer length for printing functions

2013-07-18 Thread Chen Gang
length need be much larger than format buffer length, so extend the error buffer length to 4096. When adding new code, also need let them within 80 column. Signed-off-by: Chen Gang --- fs/reiserfs/prints.c | 93 +++--- 1 files changed, 58 insertions

Re: [PATCH v2] kernel/params.c: add/modify failure processing code when sysfs_create_file() fails.

2013-07-21 Thread Chen Gang
Hello Maintainers: Please help check this patch, when you have time. Thanks. On 07/11/2013 12:06 PM, Chen Gang wrote: > When sysfs_create_file() fails, need consider about it. And process it > with BUG_ON(), because sysfs_create_file() can fail due to OOM (not at > boot) or name du

Re: [PATH v4] itimers: Remove bogus NULL pointer check in sys_getitimer()

2013-07-21 Thread Chen Gang
Hello Maintainers: Please help check this patch, when you have time. Thanks. On 07/05/2013 09:28 AM, Chen Gang wrote: > Hello Maintainers: > > Is this patch under the normal work flow (or I should need a little more > patience) ? > > Thanks. > > On 06/25/2013 0

[PATCH] kernel/irq/devres.c: move "kernel/irq/devres.c" to "drivers/base/devres_irq.c"

2013-07-23 Thread Chen Gang
drivers/built-in.o: In function `dw_dma_probe': (.text+0x3747a): undefined reference to `devm_request_threaded_irq' Signed-off-by: Chen Gang --- drivers/base/Makefile |2 +- drivers/base/devres_irq.c | 94 ++

Re: [PATCH] kernel/irq/devres.c: move "kernel/irq/devres.c" to "drivers/base/devres_irq.c"

2013-07-23 Thread Chen Gang
"kernel/"). Welcome any other members suggestions or completions. Thanks. On 07/23/2013 03:36 PM, Chen Gang wrote: > "kernel/irq/devres.c" is a driver extension tool for irq (with devres) > which is independent on 'GENERIC_HARDIRQS', so it is not suitable to &

Re: [PATCH, re-send] Always trap on BUG()

2013-07-23 Thread Chen Gang
ly ? Thanks. -- Chen Gang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] kernel/irq/devres.c: move "kernel/irq/devres.c" to "drivers/base/devres_irq.c"

2013-07-23 Thread Chen Gang
On 07/23/2013 11:31 PM, Greg KH wrote: > On Tue, Jul 23, 2013 at 03:36:04PM +0800, Chen Gang wrote: >> "kernel/irq/devres.c" is a driver extension tool for irq (with devres) >> which is independent on 'GENERIC_HARDIRQS', so it is not suitable to >> s

[PATCH] drivers: mfd: mfd-core: disable irq_domain related code when 'HAVE_GENERIC_HARDIRQS' disabled.

2013-07-23 Thread Chen Gang
related error: (with allmodconfig under s390) ERROR: "irq_create_mapping" [drivers/mfd/mfd-core.ko] undefined! Signed-off-by: Chen Gang --- drivers/mfd/mfd-core.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c

Re: [PATCH] drivers: mfd: mfd-core: disable irq_domain related code when 'HAVE_GENERIC_HARDIRQS' disabled.

2013-07-23 Thread Chen Gang
On 07/24/2013 01:02 PM, Heiko Carstens wrote: > On Wed, Jul 24, 2013 at 11:33:04AM +0800, Chen Gang wrote: >> > 'irq_domain' depends on hard irqs, so for the architectures which have >> > no hard irqs, but still need mfd (e.g. s390), need disable the related >&

Re: [PATCH] kernel/irq/devres.c: move "kernel/irq/devres.c" to "drivers/base/devres_irq.c"

2013-07-25 Thread Chen Gang
this issue soon. If no direct cause, it is not a good idea to spend members expensive time resources only for one discussing. Thanks. On 07/24/2013 09:59 AM, Chen Gang wrote: > On 07/23/2013 11:31 PM, Greg KH wrote: >> On Tue, Jul 23, 2013 at 03:36:04PM +0800, Chen Gang wrote: >&

Re: [PATCH, re-send] Always trap on BUG()

2013-07-25 Thread Chen Gang
On 07/26/2013 06:05 AM, Ingo Molnar wrote: > * Chen Gang wrote: > >> On 07/23/2013 05:36 PM, Ingo Molnar wrote: >>> >>> (the crazies can keep a separate patch to remove even more of BUG() to win >>> a K or two.) >>> >> >> Excuse me,

Re: [PATCH v2] drivers/block/xen-blkback: preq.dev is used without initialized

2013-03-04 Thread Chen Gang
于 2013年03月01日 21:43, Konrad Rzeszutek Wilk 写道: > On Thu, Feb 28, 2013 at 10:34:23AM +0800, Chen Gang wrote: >> >> if call xen_vbd_translate failed, the preq.dev will be not initialized. >> so use blkif->vbd.pdevice instead (still better to print relative info). >

[PATCH v2] kernel/acct.c: cleanup, also better to set related variable to NULL after kfree

2013-05-12 Thread Chen Gang
After kfree acct, also better to set ns->bacct to NULL. Currently, it is as a cleanup patch. Signed-off-by: Chen Gang --- kernel/acct.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kernel/acct.c b/kernel/acct.c index 85389fe..91a23eb 100644 --- a/kernel/acc

Re: [PATCH v2] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures

2013-05-12 Thread Chen Gang
On 05/10/2013 07:29 PM, Chen Gang wrote: > On 05/10/2013 05:50 PM, Chen Gang wrote: >> On 05/10/2013 10:08 AM, Chen Gang wrote: >>> On 05/10/2013 04:11 AM, Andrew Morton wrote: >>>>>>>>> For me, after 'rule->tree = NULL', all things seems

Re: [PATCH] kernel/module.c: for looping, need use 'goto' instead of 'break' to jump out in time

2013-05-12 Thread Chen Gang
On 05/13/2013 09:17 AM, Rusty Russell wrote: > Chen Gang writes: >> > On 2013年05月08日 08:29, Rusty Russell wrote: >>> >> Chen Gang writes: >>>>> >>> > In the 'for' looping, when error occurs, the 'break' only jump out

[PATCH v2] kernel/module.c: cleanup patch for looping, let return 'bool' value instead of real error number.

2013-05-13 Thread Chen Gang
For looping in simplify_symbols(), when multiple errors occur, the original error number will be override (the original related commit "1da177e Linux-2.6.12-rc"). We focus on printing all errors as much as possible, and not focus on the return error number (only know whether succeed or not is eno

Re: [PATCH v2] kernel/module.c: cleanup patch for looping, let return 'bool' value instead of real error number.

2013-05-13 Thread Chen Gang
as it can, but the user usually mainly focus on the first error or warning. So I think the suitable fix is to still print all problems, but should return the first error code (not return the last error code). Please help check, thanks. On 05/13/2013 08:24 PM, Chen Gang wrote: > >

[Suggestion] fs/namespace.c: the direct cause of the warning for: "ida_remove called for id=0 which is not allocated" with mnt_release_group_id()

2013-05-14 Thread Chen Gang
Hello Maintainers: After call collect_mounts(), then call drop_collected_mounts(), it will report an warning: "ida_remove called for id=0 which is not allocated" (one sample is audit_add_tree_rule() in kernel/audit_tree.c). The direct cause (maybe also be the root cause): collect_mounts() passs

[Suggestion] kernel/irqdesc.c: not checking whether failure occurs for alloc_desc() in early_irq_init().

2013-05-14 Thread Chen Gang
used ?) I think, it is better to also check alloc_desc() return value in early_irq_init(). Please help check when you have time. Thanks. -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@

[PATCH] kernel/irq/irqdomain.c: before use 'irq_data', need check it whether valid.

2013-05-14 Thread Chen Gang
Since irq_data may be NULL, if so, we WARN_ON(), and continue, 'hwirq' which related with 'irq_data' has to initialize later, or it will cause issue. Signed-off-by: Chen Gang --- kernel/irq/irqdomain.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) dif

[PATCH] kernel/workqueue.c: better to free related resources when failure occurs in wq_numa_init()

2013-05-14 Thread Chen Gang
When NUMA node mapping not available for one cpu, need disabling NUMA support and proceed. Also better to release unused resources (the original code can not cause issue, only waste some memory). Signed-off-by: Chen Gang --- kernel/workqueue.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] kernel/workqueue.c: kfree issue, need check flag 'WQ_UNBOUND' when processing failure.

2013-05-14 Thread Chen Gang
When failure occurs in __alloc_workqueue_key(), if 'flags' has 'WQ_UNBOUND', the destroy_workqueue() will not release 'wq'. In this situation, we need release it, or will cause memory leak. And also simplify the related code. Signed-off-by: Chen Gang

Re: [PATCH] kernel/workqueue.c: kfree issue, need check flag 'WQ_UNBOUND' when processing failure.

2013-05-14 Thread Chen Gang
On 05/14/2013 11:20 PM, Tejun Heo wrote: > On Tue, May 14, 2013 at 09:06:40PM +0800, Chen Gang wrote: >> err_destroy: >> destroy_workqueue(wq); >> +if (flags & WQ_UNBOUND) { >> +err_free_wq: >> +free_workqueue_attrs(wq->

Re: [PATCH] kernel/workqueue.c: better to free related resources when failure occurs in wq_numa_init()

2013-05-14 Thread Chen Gang
On 05/14/2013 11:17 PM, Tejun Heo wrote: > On Tue, May 14, 2013 at 08:25:20PM +0800, Chen Gang wrote: >> >> When NUMA node mapping not available for one cpu, need disabling NUMA >> support and proceed. >> >> Also better to release unused resources (the original

[PATCH] kernel/workqueue.c: need call device_remove_file() when failure occurs after called device_create_file()

2013-05-14 Thread Chen Gang
emove_file() explictly and then call device_unregister(), please reference drivers/base/*.c (e.g node.c or cpu.c). Signed-off-by: Chen Gang --- kernel/workqueue.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 1ae6028..de11

Re: [PATCH] kernel/workqueue.c: kfree issue, need check flag 'WQ_UNBOUND' when processing failure.

2013-05-15 Thread Chen Gang
On 05/16/2013 05:11 AM, Tejun Heo wrote: > On Wed, May 15, 2013 at 09:34:36AM +0800, Chen Gang wrote: >> On 05/14/2013 11:20 PM, Tejun Heo wrote: >>> On Tue, May 14, 2013 at 09:06:40PM +0800, Chen Gang wrote: >>>> err_destroy: >>>>destroy_wor

Re: [PATCH] kernel/workqueue.c: need call device_remove_file() when failure occurs after called device_create_file()

2013-05-15 Thread Chen Gang
On 05/16/2013 05:22 AM, Tejun Heo wrote: > On Wed, May 15, 2013 at 02:13:14PM +0800, Chen Gang wrote: >> >> In workqueue_sysfs_register(), when failure occurs after called >> device_create_file(), need call device_remove_file() to release the >> related resources,

Re: [PATCH] kernel/workqueue.c: need call device_remove_file() when failure occurs after called device_create_file()

2013-05-15 Thread Chen Gang
On 05/16/2013 11:33 AM, Chen Gang wrote: > On 05/16/2013 05:22 AM, Tejun Heo wrote: >> On Wed, May 15, 2013 at 02:13:14PM +0800, Chen Gang wrote: >>> >>> In workqueue_sysfs_register(), when failure occurs after called >>> device_create_file(), need call

Re: [PATCH] kernel/workqueue.c: need call device_remove_file() when failure occurs after called device_create_file()

2013-05-15 Thread Chen Gang
On 05/16/2013 12:16 PM, Chen Gang wrote: > On 05/16/2013 11:33 AM, Chen Gang wrote: >> On 05/16/2013 05:22 AM, Tejun Heo wrote: >>> On Wed, May 15, 2013 at 02:13:14PM +0800, Chen Gang wrote: >>>> >>>> In workqueue_sysfs_register(), when failure occurs af

[PATCH] kernel/debug/kdb: code enhancement for 3 areas.

2013-05-16 Thread Chen Gang
unsigned long' instead of 'long'. If "case 'A'" happen in function kdb_task_state_string(), can return ~0UL directly to save the useless looping. Signed-off-by: Chen Gang --- kernel/debug/kdb/kdb_main.c|3 --- kernel/debug/kdb/kdb_support.c |5 ++---

[PATCH v2] kernel: debug: memcpy overlaped, use memmove instead of memcpy.

2013-05-16 Thread Chen Gang
For memcpy(), src and dest are overlaped: for default implementaion or some architectures, it is OK, but we can not be sure that it is OK for all platforms, and in this condition, the performance are not quite important. So let memmove instead of memcpy. Signed-off-by: Chen Gang --- kernel

Re: [PATCH] kernel: debug: kdb: strncpy issue, using strlcpy instead of strncpy.

2013-05-16 Thread Chen Gang
Hello Maintainers: Please help check and apply this patch when you hanve time, thanks. It is already Acked-by Anton, please see below. Thanks. On Wed, Apr 17, 2013 at 05:43:13PM +0800, Chen Gang wrote: > Hello maintainers: > > please help check this patch, when you have time, thank

[PATCH v2] kernel: debug: kdb: strncpy issue, using strlcpy instead of strncpy

2013-05-16 Thread Chen Gang
'kdb_prompt_str' is NUL terminated string, need always set '\0' at the end. Or kdb_printf() below will cause issue. Signed-off-by: Chen Gang --- kernel/debug/kdb/kdb_io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/debug/kdb/kdb_io.

Re: [PATCH] Staging: Android: looping issue, need break when get value firstly.

2013-04-06 Thread Chen Gang
my patch seems minor (only can increasing a little performance). it is not quite suitable to spend much time to test a minor patch !! so whether what will happen, my patch seems obsoleted !! :-( -- Chen Gang Asianux Corporation -- To unsubscribe from this list: send the line &quo

Re: [PATCH] drivers/gpu/drm/nouveau: remove erroneous semicolon

2013-04-06 Thread Chen Gang
Hello Greg KH: when you have time, can you help to check this patch whether OK ? thanks. gchen. On 2013年04月03日 16:01, Chen Gang wrote: > Hello maintainers: > > when you have time, please help to check this patch whether is OK. > > thanks. > > gchen. > &

[PATCH] Drivers: Base: Regmap: fix warnings, use %lu instead of %d for printf format

2013-04-06 Thread Chen Gang
fix warnings (with EXTRA_CFLAGS=-W): format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat] Signed-off-by: Chen Gang --- drivers/base/regmap/regcache.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/base/regmap

[PATCH] Drivers: Misc: fix warnings, unsigned long will never < 0

2013-04-06 Thread Chen Gang
val is unsigned long which never < 0 Signed-off-by: Chen Gang --- drivers/misc/tsl2550.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 1e7bc0e..558dd20 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/m

Re: [PATCH] drivers/scsi/cxgbi: using ccflags-y instead of EXTRA_CFLAGS in Kbuild

2013-04-06 Thread Chen Gang
Hello Maintainers: please help check it when you have time. thanks. gchen. On 2013年02月28日 14:34, Chen Gang wrote: > > need using ccflags-y instead of EXTRA_CFLAGS > can reference scripts/checkpatch.pl (1755..1766) > > when make EXTRA_CFLAGS=-W, the compiling issue

Re: [PATCH] Drivers: Misc: fix warnings, unsigned long will never < 0

2013-04-06 Thread Chen Gang
also has another 'unsigned long val' warnings, I will send patch v2 to merge them together. On 2013年04月07日 11:09, Chen Gang wrote: > > val is unsigned long which never < 0 > > Signed-off-by: Chen Gang > --- > drivers/misc/tsl2550.c |2 +- > 1

[PATCH v2] Drivers: Misc: fix warnings, unsigned long will never < 0

2013-04-06 Thread Chen Gang
val is unsigned long which never < 0 Signed-off-by: Chen Gang --- drivers/misc/tsl2550.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 1e7bc0e..5bf9448 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/m

Re: [PATCH] drivers/gpu/drm/nouveau: remove erroneous semicolon

2013-04-06 Thread Chen Gang
On 2013年04月07日 11:49, Greg KH wrote: > On Sun, Apr 07, 2013 at 09:03:55AM +0800, Chen Gang wrote: >> Hello Greg KH: >> >> when you have time, can you help to check this patch whether OK ? > > No. > > Why ? does it also need a test ?? -- Chen Gang Asia

Re: [PATCH] drivers/gpu/drm/nouveau: remove erroneous semicolon

2013-04-06 Thread Chen Gang
thank you very much for your reply, firstly. On 2013年04月07日 12:09, Joe Perches wrote: > On Sun, 2013-04-07 at 11:57 +0800, Chen Gang wrote: >> > On 2013年04月07日 11:49, Greg KH wrote: >>> > > On Sun, Apr 07, 2013 at 09:03:55AM +0800, Chen Gang wrote: >>>&g

[PATCH] kernel: audit: beautify code, for extern function, better to check its parameters by itself

2013-04-07 Thread Chen Gang
__audit_socketcall is an extern function. better to check its parameters by itself. also can return error code, when fail (find invalid parameters). also use macro instead of real hard code number also give related comments for it. Signed-off-by: Chen Gang --- include/linux

Re: [PATCH] Drivers: Base: Regmap: fix warnings, use %lu instead of %d for printf format

2013-04-07 Thread Chen Gang
On 2013年04月07日 17:08, Bjørn Mork wrote: > Chen Gang writes: > >> > fix warnings (with EXTRA_CFLAGS=-W): >> > format ‘%d’ expects argument of type ‘int’, >> > but argument 4 has type ‘size_t’ [-Wformat] >> > >> > Signed-off-by: Chen

[PATCH v2] Drivers: Base: Regmap: fix warnings, use %zu instead of %d for printf format

2013-04-07 Thread Chen Gang
fix warnings (with EXTRA_CFLAGS=-W): format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat] Signed-off-by: Chen Gang --- drivers/base/regmap/regcache.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/base/regmap

[PATCH] kernel: debug: memcpy overlaped, use memmove instead of memcpy.

2013-04-07 Thread Chen Gang
. Signed-off-by: Chen Gang --- kernel/debug/kdb/kdb_support.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/debug/kdb/kdb_support.c b/kernel/debug/kdb/kdb_support.c index d35cc2d..990b3cc 100644 --- a/kernel/debug/kdb/kdb_support.c +++ b/kernel/debug/kdb

<    1   2   3   4   5   6   7   8   9   10   >