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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VddbUBmPJta93NqdNc9WTEVN2bqimYOSbi9ejNT2rg0kw@mail.gmail.com>
Date:   Tue, 22 May 2018 23:29:18 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Yisheng Xie <xieyisheng1@...wei.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 27/33] sched/debug: use match_string() helper

On Tue, May 22, 2018 at 3:10 PM, Yisheng Xie <xieyisheng1@...wei.com> wrote:

>>> +       i = match_string(sched_feat_names, __SCHED_FEAT_NR, cmp);
>>> +       if (i >= 0) {
>>
>> Why not
>>
>> if (i < 0)
>>  return i;
>
> if i >=0 it will also return i. so need return i just if (i < 0), right ?

Looking to the only (modified) caller, I think yes, either you return
error code or just 0.

>>> -       if (i == __SCHED_FEAT_NR)
>>> +       if (i < 0)
>>>                 return -EINVAL;
>>
>> Now it would be
>>

>> if (i < 0)

...even if (i) and rename i to ret to show the change in returned value meaning.

>>  return i;
>
> Right, will change it in next version

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ