]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Use the return of str_has_prefix() to remove open coded numbers
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 22 Dec 2018 04:10:26 +0000 (23:10 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 23 Dec 2018 03:52:30 +0000 (22:52 -0500)
commit343deb7365254df5c88d4f78c847ff72d0a0cba1
tree4f2ae9eccd5478a2689171c8ce2c6466d4b9c247
parent94a2453fe9d9bef5740032a2fb9c4ad9e01a8253
tracing: Use the return of str_has_prefix() to remove open coded numbers

There are several locations that compare constants to the beginning of
string variables to determine what commands should be done, then the
constant length is used to index into the string. This is error prone as the
hard coded numbers have to match the size of the constants. Instead, use the
len returned from str_has_prefix() and remove the open coded string length
sizes.

Cc: Joe Perches <joe@perches.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org> (for trace_probe part)
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c
kernel/trace/trace_probe.c
kernel/trace/trace_stack.c