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:   Sat, 19 Nov 2016 09:41:12 +0300
From:   Eugene Korenevsky <ekorenevsky@...il.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v5] USB hub_probe: rework ugly
 goto-into-compound-statement

> Ok, I'm going to be really pedantic here and ask that you spell this
> last statement out:
>        if (usb...)
>                 return true;
>        return false;


> 
> Also, the comment should say:
> 	/* If the first endpoint is not interrupt IN, we... */
> 

It's better to inverse the condition and return false:

```
if (!usb...)
        return false;
return true;
```

This is exactly what is said in the comment ("If the first endpoint...
we'd better punt!"). And does not break the composition of the entire
function (all `if` bodies return false, last statement is `return
true`).

-- 
Eugene

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ