Re: [PATCH 8/9] trace: use this_cpu_ptr per-cpu helper

From: Christoph Lameter
Date: Fri Nov 02 2012 - 13:53:17 EST


On Fri, 2 Nov 2012, Shan Wei wrote:

> Christoph Lameter said, at 2012/11/1 1:50:
> >>
> >> - buffer = per_cpu_ptr(percpu_buffer, smp_processor_id());
> >> + buffer = this_cpu_ptr(percpu_buffer);
> >>
> >> return buffer->buffer;
> >
> >
> > Just do a
> >
> > return this_cpu_read(percpu_buffer->buffer);
> >
> > and get rid of the this_cpu_ptr op
>
> can not do that.
> kernel/trace/trace.c:1515: error: incompatible types when assigning to type 'char[1024]' from type 'char *'

hmm.... what is actually returned is a pointer to char right? And buffer
is char[1024] so I guess then you need to pass a pointer to char to
this_cpu_read.

return this_cpu_read(&(percpu_buffer->buffer))
--
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/