lkml.org 
[lkml]   [2018]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 27/33] sched/debug: use match_string() helper
On Tue, May 22, 2018 at 3:10 PM, Yisheng Xie <xieyisheng1@huawei.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

\
 
 \ /
  Last update: 2018-05-22 22:30    [W:0.072 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site