tracing: Use str_has_prefix() in synth_event_create()
Since we now have a str_has_prefix() that returns the length, we can use that instead of explicitly calculating it. Link: http://lkml.kernel.org/r/03418373fd1e80030e7394b8e3e081c5de28a710.1549309756.git.tom.zanussi@linux.intel.com Cc: Joe Perches <joe@perches.com> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
745cfeaac0
commit
ed581aaf99
@ -1316,8 +1316,8 @@ static int synth_event_create(int argc, const char **argv)
|
|||||||
|
|
||||||
/* This interface accepts group name prefix */
|
/* This interface accepts group name prefix */
|
||||||
if (strchr(name, '/')) {
|
if (strchr(name, '/')) {
|
||||||
len = sizeof(SYNTH_SYSTEM "/") - 1;
|
len = str_has_prefix(name, SYNTH_SYSTEM "/");
|
||||||
if (strncmp(name, SYNTH_SYSTEM "/", len))
|
if (len == 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
name += len;
|
name += len;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user