From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZc5w-00008S-AU for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:18:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZc5u-00007h-OL for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:18:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZc5u-00007Z-JM for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:18:54 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JZc5u-00071T-6u for qemu-devel@nongnu.org; Wed, 12 Mar 2008 21:18:54 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] mipsnet incorrect device ID fix Date: Thu, 13 Mar 2008 01:18:46 +0000 References: <47BE1B61.8080604@bravegnu.org> <20080313010939.GA5914@volta.aurel32.net> In-Reply-To: <20080313010939.GA5914@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <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: qemu-devel@nongnu.org Cc: "Vijay Kumar B." , Aurelien Jarno > 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. Paul