[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190729151346.9280-1-hslester96@gmail.com>
Date: Mon, 29 Jul 2019 23:13:46 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Tejun Heo <tj@...nel.org>, Li Zefan <lizefan@...wei.com>,
Johannes Weiner <hannes@...xchg.org>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH 01/12] rdmacg: 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/cgroup/rdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c
index ae042c347c64..fd12a227f8e4 100644
--- a/kernel/cgroup/rdma.c
+++ b/kernel/cgroup/rdma.c
@@ -379,7 +379,7 @@ static int parse_resource(char *c, int *intval)
return -EINVAL;
return i;
}
- if (strncmp(value, RDMACG_MAX_STR, len) == 0) {
+ if (str_has_prefix(value, RDMACG_MAX_STR)) {
*intval = S32_MAX;
return i;
}
--
2.20.1
Powered by blists - more mailing lists