summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-ktd2692.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-08-09 15:10:34 +0800
committerPetr Mladek <pmladek@suse.com>2019-08-16 09:54:08 +0200
commit35c35493b0e3343522256f6054516f4e2161a6d4 (patch)
tree44d06154bcf3d4b1fa7b2cfb09c4f0e6ed04183d /drivers/leds/leds-ktd2692.c
parent8ebea6ea1a7ed5d67ecbb2a493c716a2a89c0be2 (diff)
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>
Diffstat (limited to 'drivers/leds/leds-ktd2692.c')
0 files changed, 0 insertions, 0 deletions