tracing: Use str_has_prefix() instead of using fixed sizes

There are several instances of strncmp(str, "const", 123), where 123 is the
strlen of the const string to check if "const" is the prefix of str. But
this can be error prone. Use str_has_prefix() instead.

Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt (VMware)
2018-12-20 13:20:07 -05:00
parent 754481e695
commit b6b2735514
5 changed files with 6 additions and 6 deletions

View File

@@ -4411,7 +4411,7 @@ static int trace_set_options(struct trace_array *tr, char *option)
cmp = strstrip(option);
if (strncmp(cmp, "no", 2) == 0) {
if (str_has_prefix(cmp, "no")) {
neg = 1;
cmp += 2;
}