Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-13 Thread Joel Becker
On Fri, Nov 13, 2009 at 08:53:06AM +0100, Ingo Molnar wrote: Sorry, I read the code wrong. This function is just a handler. The caller, dlm_send_begin_reco_message(), expects the positive EAGAIN as a non-error case. Well, at minimum the error code usage is very confused. The

[patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Ingo Molnar
* Andrew Morton a...@linux-foundation.org wrote: @@ -3730,7 +3730,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf, s = kmalloc(sizeof(*s), GFP_KERNEL); if (!s) - return ENOMEM; + return -ENOMEM; trace_seq_init(s); lol,

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Dave Airlie
On Thu, Nov 12, 2009 at 6:10 PM, Ingo Molnar mi...@elte.hu wrote: * Andrew Morton a...@linux-foundation.org wrote: @@ -3730,7 +3730,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,     s = kmalloc(sizeof(*s), GFP_KERNEL);     if (!s) -           return ENOMEM; +      

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread roel kluin
* Andrew Morton a...@linux-foundation.org wrote: Andy, can we have a checkpatch rule please? Note, that will upset creative uses of error codes i guess, such as fs/xfs/. But yeah, +1 from me too. Ob'post'mortem - looked for similar patterns in the kernel and there's quite a few bugs

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Mike Christie
roel kluin wrote: * Andrew Morton a...@linux-foundation.org wrote: Andy, can we have a checkpatch rule please? Note, that will upset creative uses of error codes i guess, such as fs/xfs/. But yeah, +1 from me too. Ob'post'mortem - looked for similar patterns in the kernel and there's quite

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Joel Becker
On Thu, Nov 12, 2009 at 11:17:58AM -0800, Joel Becker wrote: On Thu, Nov 12, 2009 at 09:10:43AM +0100, Ingo Molnar wrote: 5 out of 8 places look buggy - i.e. more than 60% - a checkpatch warning would avoid real bugs here. (even ignoring the cleanliness effects of using proper error

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Joel Becker
On Thu, Nov 12, 2009 at 09:10:43AM +0100, Ingo Molnar wrote: 5 out of 8 places look buggy - i.e. more than 60% - a checkpatch warning would avoid real bugs here. (even ignoring the cleanliness effects of using proper error propagation) Cc:-ed affected maintainers. The rightmost column are

Re: [patch] Fix: 'return -ENOMEM' instead of 'return ENOMEM'

2009-11-12 Thread Ingo Molnar
* Joel Becker joel.bec...@oracle.com wrote: On Thu, Nov 12, 2009 at 11:17:58AM -0800, Joel Becker wrote: On Thu, Nov 12, 2009 at 09:10:43AM +0100, Ingo Molnar wrote: 5 out of 8 places look buggy - i.e. more than 60% - a checkpatch warning would avoid real bugs here. (even ignoring the