All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Namhyung Kim <namhyung@gmail.com>
Subject: [for-next][PATCH 4/4] tracing: Fix check of ftrace_trace_arrays list_empty() check
Date: Tue, 10 Jun 2014 21:59:52 -0400	[thread overview]
Message-ID: <20140611020108.600070226@goodmis.org> (raw)
In-Reply-To: 20140611015948.013451560@goodmis.org

[-- Attachment #1: 0003-tracing-Fix-check-of-ftrace_trace_arrays-list_empty-.patch --]
[-- Type: text/plain, Size: 1038 bytes --]

From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>

The check that tests if ftrace_trace_arrays is empty in
top_trace_array(), uses the .prev pointer:

  if (list_empty(ftrace_trace_arrays.prev))

instead of testing the variable itself:

  if (list_empty(&ftrace_trace_arrays))

Although it is technically correct, it is awkward and confusing.
Use the proper method.

Link: http://lkml.kernel.org/r/87oay1bas8.fsf@sejong.aot.lge.com

Reported-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 9e82551dd566..9258f5a815db 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -252,7 +252,7 @@ static inline struct trace_array *top_trace_array(void)
 {
 	struct trace_array *tr;
 
-	if (list_empty(ftrace_trace_arrays.prev))
+	if (list_empty(&ftrace_trace_arrays))
 		return NULL;
 
 	tr = list_entry(ftrace_trace_arrays.prev,
-- 
2.0.0.rc2



      parent reply	other threads:[~2014-06-11  2:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  1:59 [for-next][PATCH 0/4] tracing: Cleanups and fixes for 3.16 Steven Rostedt
2014-06-11  1:59 ` [for-next][PATCH 1/4] ring-buffer: Check if buffer exists before polling Steven Rostedt
2014-06-11  1:59 ` [for-next][PATCH 2/4] tracing: Cleanup saved_cmdlines_size changes Steven Rostedt
2014-06-11  1:59 ` [for-next][PATCH 3/4] tracing: Fix leak of per cpu max data in instances Steven Rostedt
2014-06-11  1:59 ` Steven Rostedt [this message]

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=20140611020108.600070226@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.