public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Wenji Huang <wenji.huang@oracle.com>
Cc: linux-kernel@vger.kernel.org, rostedt@goodmis.org,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 2/3] trace: provide correct return value after outputting the event.
Date: Tue, 10 Feb 2009 16:06:25 +0100	[thread overview]
Message-ID: <20090210150624.GG5836@nowhere> (raw)
In-Reply-To: <1234245785-14526-1-git-send-email-wenji.huang@oracle.com>

On Tue, Feb 10, 2009 at 01:03:05AM -0500, Wenji Huang wrote:
> This patch is to make the function early return once failure and give
> correct return value in case of success.
> 
> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
> ---
>  kernel/trace/trace_functions_graph.c |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 782ec0f..519a0ca 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -186,30 +186,30 @@ verif_pid(struct trace_seq *s, pid_t pid, int cpu, pid_t *last_pids_cpu)
>  	ret = trace_seq_printf(s,
>  		" ------------------------------------------\n");
>  	if (!ret)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
>  	ret = print_graph_cpu(s, cpu);
>  	if (ret == TRACE_TYPE_PARTIAL_LINE)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
>  	ret = print_graph_proc(s, prev_pid);
>  	if (ret == TRACE_TYPE_PARTIAL_LINE)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
>  	ret = trace_seq_printf(s, " => ");
>  	if (!ret)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
>  	ret = print_graph_proc(s, pid);
>  	if (ret == TRACE_TYPE_PARTIAL_LINE)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
>  	ret = trace_seq_printf(s,
>  		"\n ------------------------------------------\n\n");
>  	if (!ret)
> -		TRACE_TYPE_PARTIAL_LINE;
> +		return TRACE_TYPE_PARTIAL_LINE;
>  
> -	return ret;
> +	return TRACE_TYPE_HANDLED;
>  }
>  
>  static struct ftrace_graph_ret_entry *
> -- 
> 1.5.6
> 

How could I have forgotten the return statements here...?

Anyway, the three patches look good.
Thanks!

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


      reply	other threads:[~2009-02-10 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10  6:03 [PATCH 2/3] trace: provide correct return value after outputting the event Wenji Huang
2009-02-10 15:06 ` Frederic Weisbecker [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=20090210150624.GG5836@nowhere \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=wenji.huang@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox