Re: [PATCH v2 03/10] locking/locktorture: Replace strncmp with str_has_prefix

2019-08-02 Thread Paul E. McKenney
On Fri, Aug 02, 2019 at 09:46:56AM +0800, Chuhong Yuan wrote: > strncmp(str, const, len) is error-prone because len > is easy to have typo. > The example is the hard-coded len has counting error > or sizeof(const) forgets - 1. > So we prefer using newly introduced str_has_prefix > to substitute suc

[PATCH v2 03/10] locking/locktorture: Replace strncmp with str_has_prefix

2019-08-01 Thread Chuhong Yuan
strncmp(str, const, len) is error-prone because len is easy to have typo. The example is the hard-coded len has counting error or sizeof(const) forgets - 1. So we prefer using newly introduced str_has_prefix to substitute such strncmp. Signed-off-by: Chuhong Yuan --- Changes in v2: - Newly dete