]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Use str_has_prefix() helper for histogram code
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 20 Dec 2018 03:38:21 +0000 (22:38 -0500)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 23 Dec 2018 03:51:01 +0000 (22:51 -0500)
commit952d1b5a7f4f39c041390f839e42932d503daab5
tree311427797eae5dfd56859c4d80edabe0afe8800e
parent7ccca174f9f8425d8f608944a58feda77dee8109
tracing: Use str_has_prefix() helper for histogram code

The tracing histogram code contains a lot of instances of the construct:

 strncmp(str, "const", sizeof("const") - 1)

This can be prone to bugs due to typos or bad cut and paste. Use the
str_has_prefix() helper macro instead that removes the need for having two
copies of the constant string.

Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c