printk: Replace strncmp() with str_has_prefix()
strncmp(str, const, len) is error-prone because len is easy to have typo. An 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. Link: http://lkml.kernel.org/r/20190809071034.17279-1-hslester96@gmail.com Cc: "Steven Rostedt" <rostedt@goodmis.org> Cc: linux-kernel@vger.kernel.org Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> [pmladek@suse.com: Slightly updated and reformatted the commit message.] Signed-off-by: Petr Mladek <pmladek@suse.com>
Showing
Please register or sign in to comment