ftrace: Remove redundant swap function
To cover the common case of sorting an array of pointers, Daniel Wagner recently modified the library sort() to use a specific swap function for size==8, in addition to the size==4 case which was already handled. Since sizeof(long) is either 4 or 8, ftrace_swap_ips() is redundant and we can just let sort() pick an appropriate and fast swap callback. Link: http://lkml.kernel.org/r/1441834023-13130-1-git-send-email-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
79ac6ef521
commit
6db0290322
1 changed files with 1 additions and 12 deletions
|
@ -4788,17 +4788,6 @@ static int ftrace_cmp_ips(const void *a, const void *b)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ftrace_swap_ips(void *a, void *b, int size)
|
|
||||||
{
|
|
||||||
unsigned long *ipa = a;
|
|
||||||
unsigned long *ipb = b;
|
|
||||||
unsigned long t;
|
|
||||||
|
|
||||||
t = *ipa;
|
|
||||||
*ipa = *ipb;
|
|
||||||
*ipb = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int ftrace_process_locs(struct module *mod,
|
static int ftrace_process_locs(struct module *mod,
|
||||||
unsigned long *start,
|
unsigned long *start,
|
||||||
unsigned long *end)
|
unsigned long *end)
|
||||||
|
@ -4818,7 +4807,7 @@ static int ftrace_process_locs(struct module *mod,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
sort(start, count, sizeof(*start),
|
sort(start, count, sizeof(*start),
|
||||||
ftrace_cmp_ips, ftrace_swap_ips);
|
ftrace_cmp_ips, NULL);
|
||||||
|
|
||||||
start_pg = ftrace_allocate_pages(count);
|
start_pg = ftrace_allocate_pages(count);
|
||||||
if (!start_pg)
|
if (!start_pg)
|
||||||
|
|
Loading…
Add table
Reference in a new issue