Skip to content

Commit ed581aa

Browse files
tzanussirostedt
authored andcommitted
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>
1 parent 745cfea commit ed581aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,8 +1316,8 @@ static int synth_event_create(int argc, const char **argv)
13161316

13171317
/* This interface accepts group name prefix */
13181318
if (strchr(name, '/')) {
1319-
len = sizeof(SYNTH_SYSTEM "/") - 1;
1320-
if (strncmp(name, SYNTH_SYSTEM "/", len))
1319+
len = str_has_prefix(name, SYNTH_SYSTEM "/");
1320+
if (len == 0)
13211321
return -EINVAL;
13221322
name += len;
13231323
}

0 commit comments

Comments
 (0)