summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEugene Surovegin <ebs@ebshome.net>2013-09-20 22:42:21 +0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-11 09:53:26 +0400
commit306474304fdfe3723562a02226c0a44e8078d3a0 (patch)
tree3aa334e366f98994ee3a085c3379bf19371ed744 /arch
parentfed8393ef9f779e51c3e0c844e549e0bbc8d6dd4 (diff)
downloadlinux-306474304fdfe3723562a02226c0a44e8078d3a0.tar.xz
powerpc: Make ftrace endian-safe.
Signed-off-by: Eugene Surovegin <surovegin@google.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/ftrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 1fb78561096a..9b27b293a922 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -174,7 +174,11 @@ __ftrace_make_nop(struct module *mod,
pr_devel(" %08x %08x\n", jmp[0], jmp[1]);
+#ifdef __LITTLE_ENDIAN__
+ ptr = ((unsigned long)jmp[1] << 32) + jmp[0];
+#else
ptr = ((unsigned long)jmp[0] << 32) + jmp[1];
+#endif
/* This should match what was called */
if (ptr != ppc_function_entry((void *)addr)) {