Messages in this thread | | | Date | Wed, 16 Dec 2009 02:22:21 +0100 | From | Frederic Weisbecker <> | Subject | Re: [PATCH 2/4] perf_event: fix getting point |
| |
On Wed, Dec 16, 2009 at 09:03:47AM +0800, Xiao Guangrong wrote: > >> @@ -1919,13 +1919,32 @@ raw_field_value(struct event *event, const char *name, void *data) > >> > >> void *raw_field_ptr(struct event *event, const char *name, void *data) > >> { > >> + void *ptr; > >> + unsigned long long value; > >> + > >> + value = raw_field_value(event, name, data); > >> + > >> + if (!value) > >> + return NULL; > >> + > >> + memcpy(&ptr, &value, sizeof(ptr)); > > > > > > > > Could you perhaps just do > > > > ptr = (void *)value; ? > > > > We can't do it in x86_32: > error: cast to pointer from integer of different size
You can just do:
ptr = (void *)(unsigned long)value;
| |