Re: [PATCH v4 3/8] PM/sleep: Replace strncmp with str_has_prefix

2019-08-26 Thread Rafael J. Wysocki
On Friday, August 9, 2019 9:10:23 AM CEST 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

[PATCH v4 3/8] PM/sleep: Replace strncmp with str_has_prefix

2019-08-09 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 to make code better. Signed-off-by: Chuhong Yuan ---