summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2009-11-12 14:58:39 +0900
committerMichael S. Tsirkin <mst@redhat.com>2009-12-01 17:52:01 +0200
commit702d6a48d812b45e261ac7f65e4edf6e39793cea (patch)
tree0260b399b98b291e97dd8d036f3ef1c66e09fc6c /hw
parentda0a3f6ad7edf011e0827d47fcfa6a6d04f4a54f (diff)
downloadqemu-702d6a48d812b45e261ac7f65e4edf6e39793cea.tar.gz
qemu-702d6a48d812b45e261ac7f65e4edf6e39793cea.tar.bz2
qemu-702d6a48d812b45e261ac7f65e4edf6e39793cea.zip
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>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/pci.c b/hw/pci.c
index c3ad1bbb89..64cf0a8a50 100644
--- a/hw/pci.c
+++ b/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)