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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 10 Feb 2015 19:38:41 +0300
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Nicholas Mc Guire <der.herr@...r.at>, Tejun Heo <tj@...nel.org>
CC:	Nicholas Mc Guire <hofrat@...dl.org>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] libata: fixup return type of wait_for_completion_timeout

On 02/10/2015 06:55 PM, Nicholas Mc Guire wrote:

>> On Tue, Feb 10, 2015 at 03:39:36AM -0500, Nicholas Mc Guire wrote:
>>> -	if (!rc) {
>>> +	if (irq_timeout == 0) {

>> Why == 0 tho?  This always bothers me.  To match this style, we'd use
>> != 0 to test the other direction.  In what way is "if (ret != 0)"
>> better than "if (ret)"?  We're negating the two tests needlessly.

> The == 0 seemed better to me than ! here because it would read

>    if (not irq_timeout) {

    No, 'irq_timeout  == 0' isn't really better.

> while it actually did time out - but this could be resolved by renaming
> irq_timeout to time_left (as was suggested by Sergei Shtylyov
> <sergei.shtylyov@...entembedded.com> for a similar patch) and then it
> would read:

>     if (time_left == 0) {

> which would nicely describe the timeout state.

    '!time_left' also would.

> if that addresses your concerns then I'll fix it up and repost.

> thx!
> hofrat

MBR, Sergei

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