Messages in this thread Patch in this message | | | From | Chuhong Yuan <> | Subject | [PATCH 05/12] genirq/debugfs: Replace strncmp with str_has_prefix | Date | Mon, 29 Jul 2019 23:14:34 +0800 |
| |
strncmp(str, const, len) is error-prone. We had better use newly introduced str_has_prefix() instead of it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com> --- kernel/irq/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index c1eccd4f6520..85d1e9aeb8ea 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -188,7 +188,7 @@ static ssize_t irq_debug_write(struct file *file, const char __user *user_buf, if (copy_from_user(buf, user_buf, size)) return -EFAULT; - if (!strncmp(buf, "trigger", size)) { + if (str_has_prefix(buf, "trigger")) { unsigned long flags; int err; -- 2.20.1
| |