public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: rostedt@goodmis.org, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] ftrace: remove redundant test on nsigned
Date: Tue, 23 Jun 2009 09:05:17 +0800	[thread overview]
Message-ID: <4A402A4D.3030804@cn.fujitsu.com> (raw)
In-Reply-To: <4A3FF508.3000304@gmail.com>

Roel Kluin wrote:
> Unsigned `cnt' cannot be less than 0.
> 

The patch is fine, but there's a typo in the title s/nsigned/unsigned

> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Or should it be `if (!cnt || cnt > MAX)' and what should MAX be then?
> 

No, note there is another check:

	if (cnt > EVENT_BUF_SIZE)
		cnt = EVENT_BUF_SIZE;

> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index aa08be6..b83f030 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -204,7 +204,7 @@ ftrace_event_write(struct file *file, const char __user *ubuf,
>  	char *buf;
>  	char ch;
>  
> -	if (!cnt || cnt < 0)
> +	if (!cnt)
>  		return 0;
>  
>  	ret = tracing_update_buffers();
> --

      reply	other threads:[~2009-06-23  1:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 21:18 [PATCH] ftrace: remove redundant test on nsigned Roel Kluin
2009-06-23  1:05 ` Li Zefan [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=4A402A4D.3030804@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roel.kluin@gmail.com \
    --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