[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190729151435.9498-1-hslester96@gmail.com>
Date: Mon, 29 Jul 2019 23:14:34 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH 05/12] genirq/debugfs: Replace strncmp with str_has_prefix
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@...il.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
Powered by blists - more mailing lists