From: Jean Guyader Subject: Re: [PATCH 1/3] qemu-xen: Change prototype for pt_pci_host_read/write Date: Fri, 25 Nov 2011 09:29:08 +0000 Message-ID: <20111125092908.GA11790@spongy.cam.xci-test.com> References: <1322056319-19725-1-git-send-email-jean.guyader@eu.citrix.com> <20174.37746.873433.6131@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20174.37746.873433.6131@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" , "allen.m.kay@intel.com" , Jean Guyader List-Id: xen-devel@lists.xenproject.org On 24/11 06:56, Ian Jackson wrote: > Jean Guyader writes ("[Xen-devel] [PATCH 1/3] qemu-xen: Change prototype for pt_pci_host_read/write"): > > pt_pci_host_read/write now takes a struct pci_dev*. > > Why ? > > Ian. I found it more elegant that having to do thing like that: val = pt_pci_host_read(0, PCI_SLOT(pci_dev->devfn), 0, config_addr, len); pci_dev is already of the right type. With the old approach you would give a B:D:F to pt_pci_host_read then the function will call to libpci to get a pci_dev from that to do the config space access. In pretty much all the cases we already have a pci_dev, so I figured that we should be using it directly. Jean