diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2019-03-06 15:35:37 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-03-12 14:33:05 +1100 |
commit | ce2918cbc31e190e7d644c684dcc2bbcb6b9a9df (patch) | |
tree | df386cb966b057efa2e125a19dc5d5d65b4545bf /hw/ppc/spapr_cpu_core.c | |
parent | dd977e4f45cba191fd65c84204cbceffc3bab48a (diff) |
spapr: Use CamelCase properly
The qemu coding standard is to use CamelCase for type and structure names,
and the pseries code follows that... sort of. There are quite a lot of
places where we bend the rules in order to preserve the capitalization of
internal acronyms like "PHB", "TCE", "DIMM" and most commonly "sPAPR".
That was a bad idea - it frequently leads to names ending up with hard to
read clusters of capital letters, and means they don't catch the eye as
type identifiers, which is kind of the point of the CamelCase convention in
the first place.
In short, keeping type identifiers look like CamelCase is more important
than preserving standard capitalization of internal "words". So, this
patch renames a heap of spapr internal type names to a more standard
CamelCase.
In addition to case changes, we also make some other identifier renames:
VIOsPAPR* -> SpaprVio*
The reverse word ordering was only ever used to mitigate the capital
cluster, so revert to the natural ordering.
VIOsPAPRVTYDevice -> SpaprVioVty
VIOsPAPRVLANDevice -> SpaprVioVlan
Brevity, since the "Device" didn't add useful information
sPAPRDRConnector -> SpaprDrc
sPAPRDRConnectorClass -> SpaprDrcClass
Brevity, and makes it clearer this is the same thing as a "DRC"
mentioned in many other places in the code
This is 100% a mechanical search-and-replace patch. It will, however,
conflict with essentially any and all outstanding patches touching the
spapr code.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr_cpu_core.c')
-rw-r--r-- | hw/ppc/spapr_cpu_core.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index ef6cbb9c29..f04e06cdf6 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -28,7 +28,7 @@ static void spapr_cpu_reset(void *opaque) CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); - sPAPRCPUState *spapr_cpu = spapr_cpu_state(cpu); + SpaprCpuState *spapr_cpu = spapr_cpu_state(cpu); target_ulong lpcr; cpu_reset(cs); @@ -116,7 +116,7 @@ const char *spapr_get_cpu_core_type(const char *cpu_type) static bool slb_shadow_needed(void *opaque) { - sPAPRCPUState *spapr_cpu = opaque; + SpaprCpuState *spapr_cpu = opaque; return spapr_cpu->slb_shadow_addr != 0; } @@ -127,15 +127,15 @@ static const VMStateDescription vmstate_spapr_cpu_slb_shadow = { .minimum_version_id = 1, .needed = slb_shadow_needed, .fields = (VMStateField[]) { - VMSTATE_UINT64(slb_shadow_addr, sPAPRCPUState), - VMSTATE_UINT64(slb_shadow_size, sPAPRCPUState), + VMSTATE_UINT64(slb_shadow_addr, SpaprCpuState), + VMSTATE_UINT64(slb_shadow_size, SpaprCpuState), VMSTATE_END_OF_LIST() } }; static bool dtl_needed(void *opaque) { - sPAPRCPUState *spapr_cpu = opaque; + SpaprCpuState *spapr_cpu = opaque; return spapr_cpu->dtl_addr != 0; } @@ -146,15 +146,15 @@ static const VMStateDescription vmstate_spapr_cpu_dtl = { .minimum_version_id = 1, .needed = dtl_needed, .fields = (VMStateField[]) { - VMSTATE_UINT64(dtl_addr, sPAPRCPUState), - VMSTATE_UINT64(dtl_size, sPAPRCPUState), + VMSTATE_UINT64(dtl_addr, SpaprCpuState), + VMSTATE_UINT64(dtl_size, SpaprCpuState), VMSTATE_END_OF_LIST() } }; static bool vpa_needed(void *opaque) { - sPAPRCPUState *spapr_cpu = opaque; + SpaprCpuState *spapr_cpu = opaque; return spapr_cpu->vpa_addr != 0; } @@ -165,7 +165,7 @@ static const VMStateDescription vmstate_spapr_cpu_vpa = { .minimum_version_id = 1, .needed = vpa_needed, .fields = (VMStateField[]) { - VMSTATE_UINT64(vpa_addr, sPAPRCPUState), + VMSTATE_UINT64(vpa_addr, SpaprCpuState), VMSTATE_END_OF_LIST() }, .subsections = (const VMStateDescription * []) { @@ -188,7 +188,7 @@ static const VMStateDescription vmstate_spapr_cpu_state = { } }; -static void spapr_unrealize_vcpu(PowerPCCPU *cpu, sPAPRCPUCore *sc) +static void spapr_unrealize_vcpu(PowerPCCPU *cpu, SpaprCpuCore *sc) { if (!sc->pre_3_0_migration) { vmstate_unregister(NULL, &vmstate_spapr_cpu_state, cpu->machine_data); @@ -206,7 +206,7 @@ static void spapr_unrealize_vcpu(PowerPCCPU *cpu, sPAPRCPUCore *sc) static void spapr_cpu_core_unrealize(DeviceState *dev, Error **errp) { - sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev)); + SpaprCpuCore *sc = SPAPR_CPU_CORE(OBJECT(dev)); CPUCore *cc = CPU_CORE(dev); int i; @@ -216,8 +216,8 @@ static void spapr_cpu_core_unrealize(DeviceState *dev, Error **errp) g_free(sc->threads); } -static void spapr_realize_vcpu(PowerPCCPU *cpu, sPAPRMachineState *spapr, - sPAPRCPUCore *sc, Error **errp) +static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, + SpaprCpuCore *sc, Error **errp) { CPUPPCState *env = &cpu->env; CPUState *cs = CPU(cpu); @@ -256,9 +256,9 @@ error: error_propagate(errp, local_err); } -static PowerPCCPU *spapr_create_vcpu(sPAPRCPUCore *sc, int i, Error **errp) +static PowerPCCPU *spapr_create_vcpu(SpaprCpuCore *sc, int i, Error **errp) { - sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_GET_CLASS(sc); + SpaprCpuCoreClass *scc = SPAPR_CPU_CORE_GET_CLASS(sc); CPUCore *cc = CPU_CORE(sc); Object *obj; char *id; @@ -285,7 +285,7 @@ static PowerPCCPU *spapr_create_vcpu(sPAPRCPUCore *sc, int i, Error **errp) goto err; } - cpu->machine_data = g_new0(sPAPRCPUState, 1); + cpu->machine_data = g_new0(SpaprCpuState, 1); object_unref(obj); return cpu; @@ -296,9 +296,9 @@ err: return NULL; } -static void spapr_delete_vcpu(PowerPCCPU *cpu, sPAPRCPUCore *sc) +static void spapr_delete_vcpu(PowerPCCPU *cpu, SpaprCpuCore *sc) { - sPAPRCPUState *spapr_cpu = spapr_cpu_state(cpu); + SpaprCpuState *spapr_cpu = spapr_cpu_state(cpu); cpu->machine_data = NULL; g_free(spapr_cpu); @@ -310,10 +310,10 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp) /* We don't use SPAPR_MACHINE() in order to exit gracefully if the user * tries to add a sPAPR CPU core to a non-pseries machine. */ - sPAPRMachineState *spapr = - (sPAPRMachineState *) object_dynamic_cast(qdev_get_machine(), + SpaprMachineState *spapr = + (SpaprMachineState *) object_dynamic_cast(qdev_get_machine(), TYPE_SPAPR_MACHINE); - sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev)); + SpaprCpuCore *sc = SPAPR_CPU_CORE(OBJECT(dev)); CPUCore *cc = CPU_CORE(OBJECT(dev)); Error *local_err = NULL; int i, j; @@ -352,8 +352,8 @@ err: } static Property spapr_cpu_core_properties[] = { - DEFINE_PROP_INT32("node-id", sPAPRCPUCore, node_id, CPU_UNSET_NUMA_NODE_ID), - DEFINE_PROP_BOOL("pre-3.0-migration", sPAPRCPUCore, pre_3_0_migration, + DEFINE_PROP_INT32("node-id", SpaprCpuCore, node_id, CPU_UNSET_NUMA_NODE_ID), + DEFINE_PROP_BOOL("pre-3.0-migration", SpaprCpuCore, pre_3_0_migration, false), DEFINE_PROP_END_OF_LIST() }; @@ -361,7 +361,7 @@ static Property spapr_cpu_core_properties[] = { static void spapr_cpu_core_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); - sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_CLASS(oc); + SpaprCpuCoreClass *scc = SPAPR_CPU_CORE_CLASS(oc); dc->realize = spapr_cpu_core_realize; dc->unrealize = spapr_cpu_core_unrealize; @@ -382,8 +382,8 @@ static const TypeInfo spapr_cpu_core_type_infos[] = { .name = TYPE_SPAPR_CPU_CORE, .parent = TYPE_CPU_CORE, .abstract = true, - .instance_size = sizeof(sPAPRCPUCore), - .class_size = sizeof(sPAPRCPUCoreClass), + .instance_size = sizeof(SpaprCpuCore), + .class_size = sizeof(SpaprCpuCoreClass), }, DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"), DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"), |