lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181104023537.2626-1-tiny.windzz@gmail.com>
Date:   Sat,  3 Nov 2018 22:35:37 -0400
From:   Yangtao Li <tiny.windzz@...il.com>
To:     rostedt@...dmis.org, mingo@...nel.org
Cc:     linux-kernel@...r.kernel.org, Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH] tracing/fgraph: remove unnecessary unlikely()

WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.

Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
 kernel/trace/trace_functions_graph.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 169b3c44ee97..f8c2a08e4985 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -201,9 +201,8 @@ ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret,
 	if (index < 0)
 		index += FTRACE_NOTRACE_DEPTH;
 
-	if (unlikely(index < 0 || index >= FTRACE_RETFUNC_DEPTH)) {
+	if (WARN_ON(index < 0 || index >= FTRACE_RETFUNC_DEPTH)) {
 		ftrace_graph_stop();
-		WARN_ON(1);
 		/* Might as well panic, otherwise we have no where to go */
 		*ret = (unsigned long)panic;
 		return;
@@ -274,9 +273,8 @@ unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
 	 */
 	ftrace_graph_return(&trace);
 
-	if (unlikely(!ret)) {
+	if (WARN_ON(!ret)) {
 		ftrace_graph_stop();
-		WARN_ON(1);
 		/* Might as well panic. What else to do? */
 		ret = (unsigned long)panic;
 	}
-- 
2.17.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ