[LTP] [PATCH V2 03/14] mem/oom: fix the timeout issue

Li Wang liwang@redhat.com
Fri Jul 14 05:16:08 CEST 2017


On Thu, Jul 13, 2017 at 5:06 PM, Richard Palethorpe <rpalethorpe@suse.de> wrote:
>
> Li Wang writes:
>
>> +       if (tst_test->timeout) {
>> +               if (tst_test->timeout > 0)
>> +                       tst_set_timeout(tst_test->timeout);
>> +       } else {
>>                 tst_set_timeout(300);
>> +       }
>
> Only a minor nit, but it is easier to read without nesting, so we could have:
>
> if (tst_test->timeout > 0) {
>    tst_set_timeout(tst_test->timeout);
> } else if (tst_test->timeout == 0) {
>    tst_set_timeout(300);
> }

Yes, seems the brace is also redundant.



-- 
Li Wang
liwang@redhat.com


More information about the ltp mailing list