Re: [PATCH 27/33] sched/debug: use match_string() helper

2018-05-22 Thread Andy Shevchenko
On Tue, May 22, 2018 at 3:10 PM, Yisheng Xie 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 (modi

Re: [PATCH 27/33] sched/debug: use match_string() helper

2018-05-22 Thread Yisheng Xie
Hi Andy, On 2018/5/22 6:13, Andy Shevchenko wrote: > On Mon, May 21, 2018 at 2:58 PM, Yisheng Xie wrote: >> match_string() returns the index of an array for a matching string, >> which can be used intead of open coded variant. >> >> Cc: Ingo Molnar >> Cc: Peter Zijlstra >> Signed-off-by: Yishen

Re: [PATCH 27/33] sched/debug: use match_string() helper

2018-05-21 Thread Andy Shevchenko
On Mon, May 21, 2018 at 2:58 PM, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > > Cc: Ingo Molnar > Cc: Peter Zijlstra > Signed-off-by: Yisheng Xie > --- > kernel/sched/debug.c | 20 +-