From: Avi Kivity Subject: Re: [PATCH v1.1 18/24] versatile_pci: convert to memory API Date: Sun, 14 Aug 2011 11:31:16 -0700 Message-ID: <4E481474.8000508@redhat.com> References: <1313080198-730-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Peter Maydell Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org On 08/11/2011 02:53 PM, Peter Maydell wrote: > On 11 August 2011 17:29, Avi Kivity wrote: > > -static uint32_t pci_vpb_config_readl (void *opaque, target_phys_addr_t addr) > > +static uint64_t pci_vpb_config_read(void *opaque, target_phys_addr_t addr, > > + unsigned size) > > { > > uint32_t val; > > - val = pci_data_read(opaque, vpb_pci_config_addr (addr), 4); > > + val = pci_data_read(opaque, vpb_pci_config_addr(addr), size); > > return val; > > } > > ...actually this looks a bit odd now, because the return type has > become uint64_t but val is still uint32_t (though pci_data_read() > still returns a uint32_t, so I suppose it's defensible). I probably should have left 64-bit data width until later. Note the core will never ask a device for 64-bit data unless the device declares it supports it. > I'm not sure why the local is there anyway, so I'd be tempted to > just return pci_data_read(...). > I'm making minimal, reviewable changes, not trying to improve things. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.