[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.1.10.0810141804550.24272@gandalf.stny.rr.com>
Date: Tue, 14 Oct 2008 18:08:48 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: LKML <linux-kernel@...r.kernel.org>
cc: Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] 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@...hat.com>
---
arch/x86/kernel/ftrace.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux-tip.git/arch/x86/kernel/ftrace.c
===================================================================
--- linux-tip.git.orig/arch/x86/kernel/ftrace.c 2008-10-14 17:55:40.000000000 -0400
+++ linux-tip.git/arch/x86/kernel/ftrace.c 2008-10-14 17:56:29.000000000 -0400
@@ -62,6 +62,7 @@ ftrace_modify_code(unsigned long ip, uns
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, uns
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();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists