linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yangtao Li <tiny.windzz@gmail.com>
To: rostedt@goodmis.org, mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, Yangtao Li <tiny.windzz@gmail.com>
Subject: [PATCH] tracing/fgraph: remove unnecessary unlikely()
Date: Sat,  3 Nov 2018 22:35:37 -0400	[thread overview]
Message-ID: <20181104023537.2626-1-tiny.windzz@gmail.com> (raw)

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

Signed-off-by: Yangtao Li <tiny.windzz@gmail.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


             reply	other threads:[~2018-11-04  2:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-04  2:35 Yangtao Li [this message]
2018-11-04 14:06 ` [PATCH] tracing/fgraph: remove unnecessary unlikely() Steven Rostedt
2018-11-04 14:32   ` Frank Lee

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=20181104023537.2626-1-tiny.windzz@gmail.com \
    --to=tiny.windzz@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.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).