PCI Using macro definition instead of a simple digit
PATCH 1/1 PCI Using macro definition instead of a simple digit
PCI_CLASS_DISPLAY_VGA has already defined in hw/pci_ids.h, so use the macro definition instead of a simple digit.
Signed-off-by Wanpeng Li <[email protected]>
--- hw/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
hw/pci.c +1 -1
@@ -1784,7 +1784,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)* for 0.11 compatibility. */ int class =pci_get_word (pdev->config +PCI_CLASS_DEVICE ); -if (class ==0x0300 ) { +if (class ==PCI_CLASS_DISPLAY_VGA ) {rom_add_vga (pdev->romfile); }else {rom_add_option (pdev->romfile,-1 );
Signature · 1 line
1.7.5.4
Am 03.03.2012 13:38, schrieb Wanpeng Li:
Quoted 4 lines
PCI_CLASS_DISPLAY_VGAhas already defined inhw/pci_ids.h, so use the macro definition instead of a simple digit.Signed-off-by Wanpeng Li <[email protected]>
Number matches,
Acked-by Andreas Färber <[email protected]>
Cc'ing mst.
There's probably much more uses of magic number in the individual PCI devices, host controllers and bridges.
Andreas
Quoted 17 lines
--- hw/pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)hw/pci.c +1
-1@@ -1784,7 +1784,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)* for 0.11 compatibility. */ int class =pci_get_word (pdev->config +PCI_CLASS_DEVICE ); -if (class ==0x0300 ) { +if (class ==PCI_CLASS_DISPLAY_VGA ) {rom_add_vga (pdev->romfile); }else {rom_add_option (pdev->romfile,-1 );
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg