linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Surovegin <ebs@ebshome.net>
To: linuxppc-dev@lists.ozlabs.org
Cc: Anton Blanchard <anton@samba.org>
Subject: [PATCH 2/2] powerpc: make ftrace endian-safe.
Date: Fri, 20 Sep 2013 11:42:21 -0700	[thread overview]
Message-ID: <1379702541-28372-2-git-send-email-ebs@ebshome.net> (raw)
In-Reply-To: <1379702541-28372-1-git-send-email-ebs@ebshome.net>

Signed-off-by: Eugene Surovegin <surovegin@google.com>
---
 arch/powerpc/kernel/ftrace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 1fb7856..9b27b29 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)) {
-- 
1.8.1.5

  reply	other threads:[~2013-09-20 18:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 18:42 [PATCH 1/2] powerpc: make kernel module helper endian-safe Eugene Surovegin
2013-09-20 18:42 ` Eugene Surovegin [this message]
2013-09-23  8:33   ` [PATCH 2/2] powerpc: make ftrace endian-safe David Laight
2013-09-23  8:34 ` [PATCH 1/2] powerpc: make kernel module helper endian-safe David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1379702541-28372-2-git-send-email-ebs@ebshome.net \
    --to=ebs@ebshome.net \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).