Re: [PATCH v2 06/10] printk: Replace strncmp with str_has_prefix

2019-08-01 Thread Joe Perches
On Fri, 2019-08-02 at 09:47 +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 such strnc

[PATCH v2 06/10] printk: 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: - Revise the