tracing: Use generic type for comparator function

Comparator function type, cmp_func_t, is defined in the types.h,
use it in the code.

Link: http://lkml.kernel.org/r/20191007135656.37734-3-andriy.shevchenko@linux.intel.com

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Andy Shevchenko
2019-10-07 16:56:56 +03:00
committed by Steven Rostedt (VMware)
parent e8877ec5db
commit 80042c8f06
4 changed files with 13 additions and 15 deletions

View File

@@ -465,10 +465,10 @@ static void *function_stat_start(struct tracer_stat *trace)
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/* function graph compares on total time */
static int function_stat_cmp(void *p1, void *p2)
static int function_stat_cmp(const void *p1, const void *p2)
{
struct ftrace_profile *a = p1;
struct ftrace_profile *b = p2;
const struct ftrace_profile *a = p1;
const struct ftrace_profile *b = p2;
if (a->time < b->time)
return -1;
@@ -479,10 +479,10 @@ static int function_stat_cmp(void *p1, void *p2)
}
#else
/* not function graph compares against hits */
static int function_stat_cmp(void *p1, void *p2)
static int function_stat_cmp(const void *p1, const void *p2)
{
struct ftrace_profile *a = p1;
struct ftrace_profile *b = p2;
const struct ftrace_profile *a = p1;
const struct ftrace_profile *b = p2;
if (a->counter < b->counter)
return -1;