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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user