lkml.org 
[lkml]   [2009]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] ftrace: convert unsigned index to signed
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?


\
 
 \ /
  Last update: 2009-01-06 23:55    [from the cache]
©2003-2011 Jasper Spaans