From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3uw4-0005Sm-SJ for qemu-devel@nongnu.org; Sat, 03 Mar 2012 14:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3uw2-00004s-Qy for qemu-devel@nongnu.org; Sat, 03 Mar 2012 14:48:08 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49230 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3uw2-0008WS-KF for qemu-devel@nongnu.org; Sat, 03 Mar 2012 14:48:06 -0500 Message-ID: <4F527571.5050609@suse.de> Date: Sat, 03 Mar 2012 20:48:01 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1330778322-30749-1-git-send-email-liwp@linux.vnet.ibm.com> In-Reply-To: <1330778322-30749-1-git-send-email-liwp@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] PCI Using macro definition instead of a simple digit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, "Michael S. Tsirkin" Am 03.03.2012 13:38, schrieb Wanpeng Li: > PCI_CLASS_DISPLAY_VGA has already defined in hw/pci_ids.h, so use the > macro definition instead of a simple digit. >=20 > Signed-off-by: Wanpeng Li Number matches, Acked-by: Andreas F=E4rber Cc'ing mst. There's probably much more uses of magic number in the individual PCI devices, host controllers and bridges. Andreas > --- > hw/pci.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) >=20 > diff --git a/hw/pci.c b/hw/pci.c > index fe71666..274d86d 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -1784,7 +1784,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bo= ol is_default_rom) > * for 0.11 compatibility. > */ > int class =3D pci_get_word(pdev->config + PCI_CLASS_DEVICE); > - if (class =3D=3D 0x0300) { > + if (class =3D=3D PCI_CLASS_DISPLAY_VGA) { > rom_add_vga(pdev->romfile); > } else { > rom_add_option(pdev->romfile, -1); --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg