Re: A CodingStyle suggestion

2007-02-04 Thread Robert P. J. Day
On Sun, 4 Feb 2007, Theodore Tso wrote: > On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: > > On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: > > > > > > In CodingStyle Chapter 16 "Function return value and names", why not > > > adding a comment about the favorable

Re: A CodingStyle suggestion

2007-02-04 Thread Manu Abraham
On 2/4/07, Theodore Tso <[EMAIL PROTECTED]> wrote: On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: > On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: > > > > In CodingStyle Chapter 16 "Function return value and names", why not > > adding a comment about the favorable

Re: A CodingStyle suggestion

2007-02-04 Thread Theodore Tso
On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: > On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: > > > > In CodingStyle Chapter 16 "Function return value and names", why not > > adding a comment about the favorable community way of checking the return > > value. ie: > >

Re: A CodingStyle suggestion

2007-02-04 Thread Manu Abraham
On 2/4/07, Ahmed S. Darwish <[EMAIL PROTECTED]> wrote: Hi all, In CodingStyle Chapter 16 "Function return value and names", why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } and not other ways

Re: A CodingStyle suggestion

2007-02-04 Thread Ahmed S. Darwish
On Sat, Feb 03, 2007 at 11:58:48PM +0200, Darwish wrote: > Hi all, > > In CodingStyle Chapter 16 "Function return value and names", why not > adding a comment about the favorable community way of checking the return > value. ie: > > ret = do_method(); > if (ret) { >/* deal with error */ > }

Re: A CodingStyle suggestion

2007-02-04 Thread Ahmed S. Darwish
On Sat, Feb 03, 2007 at 11:58:48PM +0200, Darwish wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } Thanks for

Re: A CodingStyle suggestion

2007-02-04 Thread Manu Abraham
On 2/4/07, Ahmed S. Darwish [EMAIL PROTECTED] wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } and not other ways

Re: A CodingStyle suggestion

2007-02-04 Thread Theodore Tso
On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret =

Re: A CodingStyle suggestion

2007-02-04 Thread Manu Abraham
On 2/4/07, Theodore Tso [EMAIL PROTECTED] wrote: On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of

Re: A CodingStyle suggestion

2007-02-04 Thread Robert P. J. Day
On Sun, 4 Feb 2007, Theodore Tso wrote: On Sat, Feb 03, 2007 at 01:59:51PM -0800, Randy Dunlap wrote: On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of

Re: A CodingStyle suggestion

2007-02-03 Thread Willy Tarreau
On Sat, Feb 03, 2007 at 04:40:42PM -0800, Randy Dunlap wrote: > On Sat, 03 Feb 2007 16:21:18 -0800 Roland Dreier wrote: > > > > Good catch :). A small grep of `access_ok' reveals that it's always used > > in the > > > form of: > > > if (!access_ok()) { .. } > > > > > > I can conclude that

Re: A CodingStyle suggestion

2007-02-03 Thread Randy Dunlap
On Sat, 03 Feb 2007 16:21:18 -0800 Roland Dreier wrote: > > Good catch :). A small grep of `access_ok' reveals that it's always used > in the > > form of: > > if (!access_ok()) { .. } > > > > I can conclude that verbal/imperative methods like `kmalloc, add_work' be > > checked as: > >

Re: A CodingStyle suggestion

2007-02-03 Thread Richard Knutsson
Ahmed S. Darwish wrote: On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 "Function return value and names", why not adding a comment about the favorable community way of checking the return value. ie: ret =

Re: A CodingStyle suggestion

2007-02-03 Thread Tim Schmielau
On Sun, 4 Feb 2007, Ahmed S. Darwish wrote: > On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: > > So: > > > > if (is_true()) { > > /* do something */ > > } > > > > is alright then? If so, I agree, but please make it real clear in the > > document ;) > > Good catch :). A

Re: A CodingStyle suggestion

2007-02-03 Thread Roland Dreier
> Good catch :). A small grep of `access_ok' reveals that it's always used in > the > form of: > if (!access_ok()) { .. } > > I can conclude that verbal/imperative methods like `kmalloc, add_work' be > checked as: > ret = do_work(); > if (ret) { ... } > and predicate methods like

Re: A CodingStyle suggestion

2007-02-03 Thread Ahmed S. Darwish
On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: > Ahmed S. Darwish wrote: > >Hi all, > > > >In CodingStyle Chapter 16 "Function return value and names", why not > >adding a comment about the favorable community way of checking the return > >value. ie: > > > >ret = do_method(); >

Re: A CodingStyle suggestion

2007-02-03 Thread Richard Knutsson
Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 "Function return value and names", why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } and not other ways like: if (do_method()) or

Re: A CodingStyle suggestion

2007-02-03 Thread Randy Dunlap
On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: > Hi all, > > In CodingStyle Chapter 16 "Function return value and names", why not > adding a comment about the favorable community way of checking the return > value. ie: > > ret = do_method(); > if (ret) { >/* deal with error */ >

Re: A CodingStyle suggestion

2007-02-03 Thread Randy Dunlap
On Sat, 3 Feb 2007 23:58:48 +0200 Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } and not

Re: A CodingStyle suggestion

2007-02-03 Thread Richard Knutsson
Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /* deal with error */ } and not other ways like: if (do_method()) or So:

Re: A CodingStyle suggestion

2007-02-03 Thread Ahmed S. Darwish
On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret = do_method(); if (ret) { /*

Re: A CodingStyle suggestion

2007-02-03 Thread Roland Dreier
Good catch :). A small grep of `access_ok' reveals that it's always used in the form of: if (!access_ok()) { .. } I can conclude that verbal/imperative methods like `kmalloc, add_work' be checked as: ret = do_work(); if (ret) { ... } and predicate methods like `acess_ok,

Re: A CodingStyle suggestion

2007-02-03 Thread Tim Schmielau
On Sun, 4 Feb 2007, Ahmed S. Darwish wrote: On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: So: if (is_true()) { /* do something */ } is alright then? If so, I agree, but please make it real clear in the document ;) Good catch :). A small grep of

Re: A CodingStyle suggestion

2007-02-03 Thread Richard Knutsson
Ahmed S. Darwish wrote: On Sat, Feb 03, 2007 at 11:56:16PM +0100, Richard Knutsson wrote: Ahmed S. Darwish wrote: Hi all, In CodingStyle Chapter 16 Function return value and names, why not adding a comment about the favorable community way of checking the return value. ie: ret =

Re: A CodingStyle suggestion

2007-02-03 Thread Randy Dunlap
On Sat, 03 Feb 2007 16:21:18 -0800 Roland Dreier wrote: Good catch :). A small grep of `access_ok' reveals that it's always used in the form of: if (!access_ok()) { .. } I can conclude that verbal/imperative methods like `kmalloc, add_work' be checked as: ret =

Re: A CodingStyle suggestion

2007-02-03 Thread Willy Tarreau
On Sat, Feb 03, 2007 at 04:40:42PM -0800, Randy Dunlap wrote: On Sat, 03 Feb 2007 16:21:18 -0800 Roland Dreier wrote: Good catch :). A small grep of `access_ok' reveals that it's always used in the form of: if (!access_ok()) { .. } I can conclude that verbal/imperative