From: Eugene Surovegin Date: Fri, 20 Sep 2013 18:42:21 +0000 (-0700) Subject: powerpc: Make ftrace endian-safe. X-Git-Tag: firefly_0821_release~176^2~4907^2~70 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=306474304fdfe3723562a02226c0a44e8078d3a0;p=firefly-linux-kernel-4.4.55.git powerpc: Make ftrace endian-safe. Signed-off-by: Eugene Surovegin Signed-off-by: Benjamin Herrenschmidt --- 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)) {