From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZcdn-00084o-CY for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:53:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZcdm-000834-CD for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:53:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZcdl-00082e-Tj for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:53:53 -0400 Received: from hall.aurel32.net ([88.191.38.19]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JZcdl-0003wx-Co for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:53:53 -0400 Date: Thu, 13 Mar 2008 02:54:00 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] mipsnet incorrect device ID fix Message-ID: <20080313015400.GA15089@volta.aurel32.net> References: <47BE1B61.8080604@bravegnu.org> <20080313010939.GA5914@volta.aurel32.net> <200803130118.47262.paul@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <200803130118.47262.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: "Vijay Kumar B." , qemu-devel@nongnu.org On Thu, Mar 13, 2008 at 01:18:46AM +0000, Paul Brook wrote: > > That's the '&' which is wrong here. The string can be accessed with > > *((uint32_t *)devid). So you can simply use: > > > > ret = le32_to_cpu(*((uint32_t *)devid)) > > No you can't. Even ignoring the aliasing violation, devid might not be > sufficiently aligned. > Oops you are right, I have been troubled by the original code. As suggested by Paul on IRC, the best is most probably to hardcode the hex values and put the string on a comment. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net