public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Weisbecker" <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>, Pekka Paalanen <pq@iki.fi>
Subject: Re: [Patch -tip 1/3] Tracing/ftrace: Relay unhandled entry output
Date: Thu, 25 Sep 2008 15:56:03 +0100	[thread overview]
Message-ID: <48DBA683.8000708@gmail.com> (raw)
In-Reply-To: <20080925123802.GA6900@elte.hu>

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

Ingo Molnar a écrit :
> ERROR: do not use assignment in if condition
> #43: FILE: kernel/trace/trace.c:1910:
> +		if ((ret = iter->trace->print_line(iter)))
> 
> ERROR: do not use assignment in if condition
> #48: FILE: kernel/trace/trace.c:1914:
> +		if ((ret = print_bin_fmt(iter)))
> 
> ERROR: do not use assignment in if condition
> #53: FILE: kernel/trace/trace.c:1918:
> +		if ((ret = print_hex_fmt(iter)))
> 
> ERROR: do not use assignment in if condition
> #58: FILE: kernel/trace/trace.c:1922:
> +		if ((ret = print_raw_fmt(iter)))
> 
> ERROR: do not use assignment in if condition
> #63: FILE: kernel/trace/trace.c:1926:
> +		if ((ret = print_lat_fmt(iter, iter->idx, iter->cpu)))
> 
> total: 5 errors, 0 warnings, 0 checks, 32 lines checked
> 
>

Oops sorry. Here it is:

Correct the coding style in the commit 
803294369973b740f4c346553850b56e4b0c3c8a
And remove the ret variable since print functions
only return 0 or 1.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---

 


[-- Attachment #2: 1.diff --]
[-- Type: text/plain, Size: 1071 bytes --]

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 50ac334..e845664 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1904,27 +1904,25 @@ static int trace_empty(struct trace_iterator *iter)
 
 static int print_trace_line(struct trace_iterator *iter)
 {
-	int ret;
-
 	if (iter->trace && iter->trace->print_line)
-		if ((ret = iter->trace->print_line(iter)))
-			return ret;
+		if (iter->trace->print_line(iter))
+			return 1;
 
 	if (trace_flags & TRACE_ITER_BIN)
-		if ((ret = print_bin_fmt(iter)))
-			return ret;
+		if (print_bin_fmt(iter))
+			return 1;
 
 	if (trace_flags & TRACE_ITER_HEX)
-		if ((ret = print_hex_fmt(iter)))
-			return ret;
+		if (print_hex_fmt(iter))
+			return 1;
 
 	if (trace_flags & TRACE_ITER_RAW)
-		if ((ret = print_raw_fmt(iter)))
-			return ret;
+		if (print_raw_fmt(iter))
+			return 1;
 
 	if (iter->iter_flags & TRACE_FILE_LAT_FMT)
-		if ((ret = print_lat_fmt(iter, iter->idx, iter->cpu)))
-			return ret;
+		if (print_lat_fmt(iter, iter->idx, iter->cpu))
+			return 1;
 
 	return print_trace_fmt(iter);
 }

  reply	other threads:[~2008-09-25 13:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-25 12:19 [Patch -tip 1/3] Tracing/ftrace: Relay unhandled entry output Frédéric Weisbecker
2008-09-25 12:38 ` Ingo Molnar
2008-09-25 14:56   ` Frédéric Weisbecker [this message]
2008-09-25 15:09     ` Pekka Paalanen
2008-09-25 15:33       ` Frédéric Weisbecker
2008-09-25 15:49         ` Pekka Paalanen
2008-09-25 15:56           ` Frédéric Weisbecker
2008-09-25 16:01             ` Pekka Paalanen
2008-09-25 16:40               ` Frédéric Weisbecker
2008-09-27 17:50                 ` Ingo Molnar
2008-09-29  9:29                   ` Frédéric Weisbecker
2008-09-27 17:53                 ` Ingo Molnar

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=48DBA683.8000708@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pq@iki.fi \
    --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