lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091216012219.GD8423@nowhere>
Date:	Wed, 16 Dec 2009 02:22:21 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
Cc:	Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	LKML <linux-kernel@...r.kernel.org>
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;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ