From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYKuj-00068X-6H for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:18:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYKuh-00067L-FB for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:18:20 -0400 Received: from [199.232.76.173] (port=56795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYKuh-00067F-7y for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:18:19 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40500) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYKug-0004CC-PX for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:18:19 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDHaZo018811 for ; Wed, 27 Aug 2008 09:17:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7RDHPtj013282 for ; Wed, 27 Aug 2008 09:17:26 -0400 Received: from zweiblum.travel.kraxel.org (vpn-4-120.str.redhat.com [10.32.4.120]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDHJtJ015786 for ; Wed, 27 Aug 2008 09:17:20 -0400 Message-ID: <48B553DF.2090108@redhat.com> Date: Wed, 27 Aug 2008 15:17:19 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 1/2] add pci config space struct References: <48B3DD9E.3060905@redhat.com> <200808271308.58878.paul@codesourcery.com> In-Reply-To: <200808271308.58878.paul@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 Paul Brook wrote: > On Tuesday 26 August 2008, Gerd Hoffmann wrote: >> Hi, >> >> This patch adds a struct for the pci config header make it easier to >> deal with it. Comes from qemu-xen. > > Adding a nice easy-to-use structure, then requiring all devices do > byteswapping themselves (negating most of the easy-to-use benefit) seems less > than ideal. Byteswapping must be done anyway, with or without the struct. Using the struct allows to avoid casting all over the place though. I'll go switch over the config header struct to use the byteswapped types, then repost together with some pci.c functions changed to use the new struct. IMHO it makes the code more readable due to hardcoded magic numbers and casts going away. cheers, Gerd