]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Make field structs of pci_msix_registers and pci_msix_vector anonymous
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 7 May 2015 17:34:01 +0000 (19:34 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 7 May 2015 17:34:01 +0000 (19:34 +0200)
"field" provides no additional information to the reader, and all
affected sub-fields have unique names, so remove this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/x86/pci.c
hypervisor/include/jailhouse/pci.h
hypervisor/pci.c
hypervisor/pci_ivshmem.c

index 043110d2ca3af987a0b4645d446984a2b9c21394..e8c94330d35943e3ecfb1b08a83009a14f949c37 100644 (file)
@@ -366,15 +366,14 @@ int arch_pci_update_msi(struct pci_device *device,
 int arch_pci_update_msix_vector(struct pci_device *device, unsigned int index)
 {
        union x86_msi_vector msi = {
-               .raw.address = device->msix_vectors[index].field.address,
-               .raw.data = device->msix_vectors[index].field.data,
+               .raw.address = device->msix_vectors[index].address,
+               .raw.data = device->msix_vectors[index].data,
        };
        struct apic_irq_message irq_msg;
        int result;
 
-       if (!device->msix_registers.field.enable ||
-           device->msix_registers.field.fmask ||
-           device->msix_vectors[index].field.masked)
+       if (!device->msix_registers.enable || device->msix_registers.fmask ||
+           device->msix_vectors[index].masked)
                return 0;
 
        irq_msg = pci_translate_msi_vector(device, index, 0, msi);
@@ -382,18 +381,18 @@ int arch_pci_update_msix_vector(struct pci_device *device, unsigned int index)
                                     irq_msg);
        // HACK for QEMU
        if (result == -ENOSYS) {
-               mmio_write64(&device->msix_table[index].field.address,
-                            device->msix_vectors[index].field.address);
-               mmio_write32(&device->msix_table[index].field.data,
-                            device->msix_vectors[index].field.data);
+               mmio_write64(&device->msix_table[index].address,
+                            device->msix_vectors[index].address);
+               mmio_write32(&device->msix_table[index].data,
+                            device->msix_vectors[index].data);
                return 0;
        }
        if (result < 0)
                return result;
 
-       mmio_write64(&device->msix_table[index].field.address,
+       mmio_write64(&device->msix_table[index].address,
                     pci_get_x86_msi_remap_address(result));
-       mmio_write32(&device->msix_table[index].field.data, 0);
+       mmio_write32(&device->msix_table[index].data, 0);
 
        return 0;
 }
index 6ccdbca5417565bf53edd2e7bbc21fdb9f806368..ab02737f961d4d4061a8bf9b0db54edcfa2768be 100644 (file)
@@ -89,7 +89,7 @@ union pci_msix_registers {
                u16 ignore:14,
                    fmask:1,
                    enable:1;
-       } __attribute__((packed)) field;
+       } __attribute__((packed));
        u32 raw;
        /** @publicsection */
 } __attribute__((packed));
@@ -102,7 +102,7 @@ union pci_msix_vector {
                u32 data;
                u32 masked:1;
                u32 reserved:31;
-       } __attribute__((packed)) field;
+       } __attribute__((packed));
        u32 raw[4];
        /** @publicsection */
 } __attribute__((packed));
index 46826aea7764f91891d570ce94e7aa9d6fdbdf7c..0b714db9a35b45c03ddbe128d1860e5a598de5c2 100644 (file)
@@ -479,7 +479,7 @@ static void pci_suppress_msix(struct pci_device *device,
        union pci_msix_registers regs = device->msix_registers;
 
        if (suppressed)
-               regs.field.fmask = 1;
+               regs.fmask = 1;
        pci_write_config(device->info->bdf, cap->start, regs.raw, 4);
 }
 
index 19707acdfd02ad66d70cdcb6dc7e043bc2320262..8f718f9c22f077da51dd020e2c0cf6b95bfc5bd8 100644 (file)
@@ -126,11 +126,11 @@ static bool ivshmem_is_msix_masked(struct pci_ivshmem_endpoint *ive)
 
        /* global mask */
        c.raw = ive->cspace[IVSHMEM_CFG_MSIX_CAP/4];
-       if (!c.field.enable || c.field.fmask)
+       if (!c.enable || c.fmask)
                return true;
 
        /* local mask */
-       if (ive->device->msix_vectors[0].field.masked)
+       if (ive->device->msix_vectors[0].masked)
                return true;
 
        /* PCI Bus Master */
@@ -143,8 +143,8 @@ static bool ivshmem_is_msix_masked(struct pci_ivshmem_endpoint *ive)
 static int ivshmem_update_msix(struct pci_ivshmem_endpoint *ive)
 {
        union x86_msi_vector msi = {
-               .raw.address = ive->device->msix_vectors[0].field.address,
-               .raw.data = ive->device->msix_vectors[0].field.data,
+               .raw.address = ive->device->msix_vectors[0].address,
+               .raw.data = ive->device->msix_vectors[0].data,
        };
        struct apic_irq_message irq_msg;
 
@@ -284,8 +284,8 @@ static int ivshmem_write_msix_control(struct pci_ivshmem_endpoint *ive, u32 val)
                .raw = ive->cspace[IVSHMEM_CFG_MSIX_CAP/4]
        };
 
-       newval.field.enable = p->field.enable;
-       newval.field.fmask = p->field.fmask;
+       newval.enable = p->enable;
+       newval.fmask = p->fmask;
        if (ive->cspace[IVSHMEM_CFG_MSIX_CAP/4] != newval.raw) {
                ive->cspace[IVSHMEM_CFG_MSIX_CAP/4] = newval.raw;
                return ivshmem_update_msix(ive);