mirror of https://gitee.com/openkylin/qemu.git
pci: clean up of pci_init_wmask().
This patch replaces for loop by memset in pci_init_wmask(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
c34369d48c
commit
3e21ffc954
6
hw/pci.c
6
hw/pci.c
|
@ -426,15 +426,15 @@ static void pci_init_cmask(PCIDevice *dev)
|
|||
|
||||
static void pci_init_wmask(PCIDevice *dev)
|
||||
{
|
||||
int i;
|
||||
int config_size = pci_config_size(dev);
|
||||
|
||||
dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
|
||||
dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
|
||||
pci_set_word(dev->wmask + PCI_COMMAND,
|
||||
PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
|
||||
for (i = PCI_CONFIG_HEADER_SIZE; i < config_size; ++i)
|
||||
dev->wmask[i] = 0xff;
|
||||
|
||||
memset(dev->wmask + PCI_CONFIG_HEADER_SIZE, 0xff,
|
||||
config_size - PCI_CONFIG_HEADER_SIZE);
|
||||
}
|
||||
|
||||
static void pci_init_wmask_bridge(PCIDevice *d)
|
||||
|
|
Loading…
Reference in New Issue