lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 4 Feb 2007 16:36:44 +0400
From:	"Manu Abraham" <abraham.manu@...il.com>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: A CodingStyle suggestion

On 2/4/07, Ahmed S. Darwish <darwish.07@...il.com> 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 if ((ret = do_method()) > value) ...


if we have some 100 lines of

ret = do_method()
if (ret) {
/* error handling */
}

This is going to additionally increase the number of lines of unnecessarily.

IMHO, when you have a large number of lines which do a similar thing ..

if ((ret = do_method()) < value)
   goto err;

could greatly reduce the number of lines, otherwise.

manu
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ