Re: [patch 2/9] perf: Use appropriate pointer type instead ofsilly typecasting

From: Arnaldo Carvalho de Melo
Date: Tue Nov 30 2010 - 13:33:47 EST


Em Tue, Nov 30, 2010 at 05:49:35PM -0000, Thomas Gleixner escreveu:
> There is no reason to use a struct sample_event pointer in struct sample_queue
> and type cast it when flushing the queue.

> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

I touched that code in a branch I'm working on, same change :-\ Well,
testing the other patches, thanks!

- Arnaldo

> tools/perf/util/session.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-2.6-tip/tools/perf/util/session.c
> ===================================================================
> --- linux-2.6-tip.orig/tools/perf/util/session.c
> +++ linux-2.6-tip/tools/perf/util/session.c
> @@ -386,7 +386,7 @@ static event__swap_op event__swap_ops[]
>
> struct sample_queue {
> u64 timestamp;
> - struct sample_event *event;
> + event_t *event;
> struct list_head list;
> };
>
> @@ -406,7 +406,7 @@ static void flush_sample_queue(struct pe
> if (iter->timestamp > limit)
> break;
>
> - ops->sample((event_t *)iter->event, s);
> + ops->sample(iter->event, s);
>
> os->last_flush = iter->timestamp;
> list_del(&iter->list);
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/