From: Steven Rostedt <rostedt@goodmis.org>
To: Namhyung Kim <namhyung.kim@lge.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@kernel.org>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Borislav Petkov <bp@alien8.de>, David Ahern <dsahern@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/7] parse-events: Fix printk_cmp()
Date: Tue, 10 Apr 2012 13:36:51 -0400 [thread overview]
Message-ID: <1334079411.23924.221.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1333940074-19052-3-git-send-email-namhyung.kim@lge.com>
On Mon, 2012-04-09 at 11:54 +0900, Namhyung Kim wrote:
> The printk_cmp function should use printk_map instead of func_map.
> Also rename the variables for consistency.
>
> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
> ---
> parse-events.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/parse-events.c b/parse-events.c
> index 5214771..f90af1a 100644
> --- a/parse-events.c
> +++ b/parse-events.c
> @@ -507,12 +507,12 @@ struct printk_list {
>
> static int printk_cmp(const void *a, const void *b)
> {
> - const struct func_map *fa = a;
> - const struct func_map *fb = b;
> + const struct printk_map *pa = a;
> + const struct printk_map *pb = b;
>
> - if (fa->addr < fb->addr)
> + if (pa->addr < pb->addr)
> return -1;
> - if (fa->addr > fb->addr)
> + if (pa->addr > pb->addr)
Ouch! This worked only because the first item in both func_map and
printk_map happened to be addr (of the same size).
-- Steve
> return 1;
>
> return 0;
next prev parent reply other threads:[~2012-04-10 17:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 2:54 [PATCH 0/7] trace-cmd: Small fixes and cleanups on libparsevent Namhyung Kim
2012-04-09 2:54 ` [PATCH 1/7] trace-cmd: Add NO_PYTHON option for Makefile Namhyung Kim
2012-04-10 17:36 ` Steven Rostedt
2012-04-09 2:54 ` [PATCH 2/7] parse-events: Fix printk_cmp() Namhyung Kim
2012-04-10 17:36 ` Steven Rostedt [this message]
2012-07-06 11:12 ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09 2:54 ` [PATCH 3/7] parse-events: Introduce extend_token() Namhyung Kim
2012-07-06 11:13 ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09 2:54 ` [PATCH 4/7] parse-events: Handle strdup failure cases Namhyung Kim
2012-04-23 15:51 ` Steven Rostedt
2012-04-24 0:35 ` Namhyung Kim
2012-04-24 0:41 ` Steven Rostedt
2012-07-06 11:14 ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09 2:54 ` [PATCH 5/7] parse-events: Fix a possible memory leak Namhyung Kim
2012-04-09 2:54 ` [PATCH 6/7] parse-events: Handle realloc() failure path Namhyung Kim
2012-07-06 11:15 ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09 2:54 ` [PATCH 7/7] parse-events: Fix a possibly wrong memory dereference Namhyung Kim
2012-04-09 17:22 ` [PATCH 0/7] trace-cmd: Small fixes and cleanups on libparsevent Frederic Weisbecker
2012-04-10 0:53 ` Namhyung Kim
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=1334079411.23924.221.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=acme@infradead.org \
--cc=bp@alien8.de \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.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
all inboxes | Powered by JetHome®