Skip to content

Commit

Permalink
powerpc: Make ftrace endian-safe.
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Surovegin <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
Eugene Surovegin authored and ozbenh committed Oct 11, 2013
1 parent fed8393 commit 3064743
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 3064743

Please sign in to comment.