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 communit

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 commun

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 l

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-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: > > r

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 = do_

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 sm

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 `ace

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 So:

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 */ > }