All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, fweisbec@gmail.com,
	roel.kluin@gmail.com, pq@iki.fi, srostedt@redhat.com
Subject: Re: [PATCH 1/3] ftrace: convert unsigned index to signed
Date: Tue, 6 Jan 2009 14:50:07 -0800	[thread overview]
Message-ID: <20090106145007.ceb20f16.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090106223405.302758015@goodmis.org>

On Tue, 06 Jan 2009 17:33:38 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <srostedt@redhat.com>
> 
> Impact: fix to unsigned compared to less than zero
> 
> Roel Kluin pointed out that there is a compare of an unsigned number
> to less than zero. A previous clean up had the unsigned index set
> to -1 for certain cases, but never converted it to signed.
> 
> Frederic Weisbecker noticed that another index is used to compare
> the above index to and it also needs to be converted to signed.
> 
> Reported-by: Roel Kluin <roel.kluin@gmail.com>
> Reported-by: Frederic Weisbecker <fweisbec@gmail.com>
> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
>  kernel/trace/ftrace.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 2f32969..3576707 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -289,7 +289,7 @@ static DEFINE_MUTEX(ftrace_regex_lock);
>  
>  struct ftrace_page {
>  	struct ftrace_page	*next;
> -	unsigned long		index;
> +	long			index;

Does that actually need to be a long type?

>  	struct dyn_ftrace	records[];
>  };
>  
> @@ -786,7 +786,7 @@ enum {
>  
>  struct ftrace_iterator {
>  	struct ftrace_page	*pg;
> -	unsigned		idx;
> +	int			idx;

because we have

        if (iter->idx >= iter->pg->index) {

Are 32-bit types actually more efficient than 64-bit types on any
64-bit hardware which we care about?  

  reply	other threads:[~2009-01-06 22:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-06 22:33 [PATCH 0/3] ftrace: important updates Steven Rostedt
2009-01-06 22:33 ` [PATCH 1/3] ftrace: convert unsigned index to signed Steven Rostedt
2009-01-06 22:50   ` Andrew Morton [this message]
2009-01-07  2:42     ` Steven Rostedt
2009-01-06 22:33 ` [PATCH 2/3] ring-buffer: rename debugfs file tracing_on to writing_enabled Steven Rostedt
2009-01-06 22:47   ` Andrew Morton
2009-01-07  2:52     ` Steven Rostedt
2009-01-06 22:33 ` [PATCH 3/3] tracing/ftrace: fix a memory leak in stat tracing Steven Rostedt
2009-01-06 22:51   ` Andrew Morton
2009-01-07  2:53     ` Steven Rostedt

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=20090106145007.ceb20f16.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=pq@iki.fi \
    --cc=roel.kluin@gmail.com \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.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.