Commit b90c73cf authored by Stefan Weil's avatar Stefan Weil Committed by Michael S. Tsirkin
Browse files

pci: Replace unneeded type casts in calls of pci_register_bar



There is no need for these type casts (as other existing
code shows). So re-write the first argument without
type cast (and remove a related TODO comment).

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarStefan Weil <weil@mail.berlios.de>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent bba5ed77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3204,10 +3204,10 @@ static int pci_cirrus_vga_initfn(PCIDevice *dev)
     /* memory #0 LFB */
     /* memory #1 memory-mapped I/O */
     /* XXX: s->vga.vram_size must be a power of two */
     pci_register_bar((PCIDevice *)d, 0, 0x2000000,
     pci_register_bar(&d->dev, 0, 0x2000000,
                      PCI_BASE_ADDRESS_MEM_PREFETCH, cirrus_pci_lfb_map);
     if (device_id == CIRRUS_ID_CLGD5446) {
         pci_register_bar((PCIDevice *)d, 1, CIRRUS_PNPMMIO_SIZE,
         pci_register_bar(&d->dev, 1, CIRRUS_PNPMMIO_SIZE,
                          PCI_BASE_ADDRESS_SPACE_MEMORY, cirrus_pci_mmio_map);
     }
     return 0;
+2 −2
Original line number Diff line number Diff line
@@ -1130,10 +1130,10 @@ static int pci_e1000_init(PCIDevice *pci_dev)
    d->mmio_index = cpu_register_io_memory(e1000_mmio_read,
            e1000_mmio_write, d);

    pci_register_bar((PCIDevice *)d, 0, PNPMMIO_SIZE,
    pci_register_bar(&d->dev, 0, PNPMMIO_SIZE,
                           PCI_BASE_ADDRESS_SPACE_MEMORY, e1000_mmio_map);

    pci_register_bar((PCIDevice *)d, 1, IOPORT_SIZE,
    pci_register_bar(&d->dev, 1, IOPORT_SIZE,
                           PCI_BASE_ADDRESS_SPACE_IO, ioport_map);

    memmove(d->eeprom_data, e1000_eeprom_template,
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ static int vt82c686b_ide_initfn(PCIDevice *dev)
    pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0);

    qemu_register_reset(via_reset, d);
    pci_register_bar((PCIDevice *)d, 4, 0x10,
    pci_register_bar(&d->dev, 4, 0x10,
                           PCI_BASE_ADDRESS_SPACE_IO, bmdma_map);

    vmstate_register(&dev->qdev, 0, &vmstate_ide_pci, d);
+3 −4
Original line number Diff line number Diff line
@@ -2177,12 +2177,11 @@ static int lsi_scsi_init(PCIDevice *dev)
    s->ram_io_addr = cpu_register_io_memory(lsi_ram_readfn,
                                            lsi_ram_writefn, s);

    /* TODO: use dev and get rid of cast below */
    pci_register_bar((struct PCIDevice *)s, 0, 256,
    pci_register_bar(&s->dev, 0, 256,
                           PCI_BASE_ADDRESS_SPACE_IO, lsi_io_mapfunc);
    pci_register_bar((struct PCIDevice *)s, 1, 0x400,
    pci_register_bar(&s->dev, 1, 0x400,
                           PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_mmio_mapfunc);
    pci_register_bar((struct PCIDevice *)s, 2, 0x2000,
    pci_register_bar(&s->dev, 2, 0x2000,
                           PCI_BASE_ADDRESS_SPACE_MEMORY, lsi_ram_mapfunc);
    QTAILQ_INIT(&s->queue);

+1 −1
Original line number Diff line number Diff line
@@ -1197,7 +1197,7 @@ qemu_irq *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus,
        pci_conf[0x3d] = 0x00; // no interrupt pin

        /* Register I/O spaces */
        pci_register_bar((PCIDevice *)opp, 0, 0x40000,
        pci_register_bar(&opp->pci_dev, 0, 0x40000,
                               PCI_BASE_ADDRESS_SPACE_MEMORY, &openpic_map);
    } else {
        opp = qemu_mallocz(sizeof(openpic_t));
Loading