lkml.org 
[lkml]   [2016]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2016-11-19 07:42    [W:0.050 / U:1.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site