From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57358 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHdu6-00056P-VT for qemu-devel@nongnu.org; Thu, 27 May 2010 10:17:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHdrV-0007BO-Qe for qemu-devel@nongnu.org; Thu, 27 May 2010 10:15:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22936) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHdrV-0007B3-KQ for qemu-devel@nongnu.org; Thu, 27 May 2010 10:15:05 -0400 Date: Thu, 27 May 2010 17:10:47 +0300 From: "Michael S. Tsirkin" Message-ID: <20100527141047.GA8287@redhat.com> References: <20100527054206.GG31807@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100527054206.GG31807@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH] pci: clean up of pci_set_default_subsystem_id(). List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org On Thu, May 27, 2010 at 02:42:06PM +0900, Isaku Yamahata wrote: > Use pci accessor function. > don't return value because it always return 0 and > the caller doesn't check the return value. > > Signed-off-by: Isaku Yamahata Applied, thanks! > --- > hw/pci.c | 12 +++++------- > 1 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index 8d84651..3362842 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -419,14 +419,12 @@ int pci_device_load(PCIDevice *s, QEMUFile *f) > return ret; > } > > -static int pci_set_default_subsystem_id(PCIDevice *pci_dev) > +static void pci_set_default_subsystem_id(PCIDevice *pci_dev) > { > - uint16_t *id; > - > - id = (void*)(&pci_dev->config[PCI_SUBSYSTEM_VENDOR_ID]); > - id[0] = cpu_to_le16(pci_default_sub_vendor_id); > - id[1] = cpu_to_le16(pci_default_sub_device_id); > - return 0; > + pci_set_word(pci_dev->config + PCI_SUBSYSTEM_VENDOR_ID, > + pci_default_sub_vendor_id); > + pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID, > + pci_default_sub_device_id); > } > > /* > -- > 1.6.6.1 >