summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-10-14 18:08:48 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-20 18:27:00 +0200
commitc513867561eeb07d24a0bdda1a18a8f91921a301 (patch)
tree77a772903b6960306607ccd9e8dd1b7d665c71a9 /arch
parent3e10e879a8c334a5927d800a3663a24d562cfa31 (diff)
downloadop-kernel-dev-c513867561eeb07d24a0bdda1a18a8f91921a301.zip
op-kernel-dev-c513867561eeb07d24a0bdda1a18a8f91921a301.tar.gz
ftrace: do not enclose logic in WARN_ON
In ftrace, logic is defined in the WARN_ON_ONCE, which can become a nop with some configs. This patch fixes it. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/ftrace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index d073d98..8821cea 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
unsigned char *new_code)
{
unsigned char replaced[MCOUNT_INSN_SIZE];
+ int ret;
/*
* Note: Due to modules and __init, code can
@@ -77,8 +78,9 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
return 2;
- WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code,
- MCOUNT_INSN_SIZE));
+ ret = __copy_to_user_inatomic((char __user *)ip, new_code,
+ MCOUNT_INSN_SIZE);
+ WARN_ON_ONCE(ret);
sync_core();
OpenPOWER on IntegriCloud