diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2015-09-09 17:27:02 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-10-01 09:32:20 -0400 |
commit | 6db0290322101f971d6c06ee652d9838f3f4ee92 (patch) | |
tree | 3690d972ab36b1647e36ff033bbff0c0011f8db8 /kernel/trace/ftrace.c | |
parent | 79ac6ef521075d0f40805df77e8890c55f538fe4 (diff) |
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>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index e76384894147..f7b78d75c605 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -4788,17 +4788,6 @@ static int ftrace_cmp_ips(const void *a, const void *b) | |||
4788 | return 0; | 4788 | return 0; |
4789 | } | 4789 | } |
4790 | 4790 | ||
4791 | static void ftrace_swap_ips(void *a, void *b, int size) | ||
4792 | { | ||
4793 | unsigned long *ipa = a; | ||
4794 | unsigned long *ipb = b; | ||
4795 | unsigned long t; | ||
4796 | |||
4797 | t = *ipa; | ||
4798 | *ipa = *ipb; | ||
4799 | *ipb = t; | ||
4800 | } | ||
4801 | |||
4802 | static int ftrace_process_locs(struct module *mod, | 4791 | static int ftrace_process_locs(struct module *mod, |
4803 | unsigned long *start, | 4792 | unsigned long *start, |
4804 | unsigned long *end) | 4793 | unsigned long *end) |
@@ -4818,7 +4807,7 @@ static int ftrace_process_locs(struct module *mod, | |||
4818 | return 0; | 4807 | return 0; |
4819 | 4808 | ||
4820 | sort(start, count, sizeof(*start), | 4809 | sort(start, count, sizeof(*start), |
4821 | ftrace_cmp_ips, ftrace_swap_ips); | 4810 | ftrace_cmp_ips, NULL); |
4822 | 4811 | ||
4823 | start_pg = ftrace_allocate_pages(count); | 4812 | start_pg = ftrace_allocate_pages(count); |
4824 | if (!start_pg) | 4813 | if (!start_pg) |