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_rng.c | |
parent | dd977e4f45cba191fd65c84204cbceffc3bab48a (diff) | |
download | qemu-ce2918cbc31e190e7d644c684dcc2bbcb6b9a9df.zip qemu-ce2918cbc31e190e7d644c684dcc2bbcb6b9a9df.tar.gz qemu-ce2918cbc31e190e7d644c684dcc2bbcb6b9a9df.tar.bz2 |
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_rng.c')
-rw-r--r-- | hw/ppc/spapr_rng.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c index 644bac9..4060987 100644 --- a/hw/ppc/spapr_rng.c +++ b/hw/ppc/spapr_rng.c @@ -29,15 +29,15 @@ #include "kvm_ppc.h" #define SPAPR_RNG(obj) \ - OBJECT_CHECK(sPAPRRngState, (obj), TYPE_SPAPR_RNG) + OBJECT_CHECK(SpaprRngState, (obj), TYPE_SPAPR_RNG) -struct sPAPRRngState { +struct SpaprRngState { /*< private >*/ DeviceState ds; RngBackend *backend; bool use_kvm; }; -typedef struct sPAPRRngState sPAPRRngState; +typedef struct SpaprRngState SpaprRngState; struct HRandomData { QemuSemaphore sem; @@ -64,10 +64,10 @@ static void random_recv(void *dest, const void *src, size_t size) } /* Handler for the H_RANDOM hypercall */ -static target_ulong h_random(PowerPCCPU *cpu, sPAPRMachineState *spapr, +static target_ulong h_random(PowerPCCPU *cpu, SpaprMachineState *spapr, target_ulong opcode, target_ulong *args) { - sPAPRRngState *rngstate; + SpaprRngState *rngstate; HRandomData hrdata; rngstate = SPAPR_RNG(object_resolve_path_type("", TYPE_SPAPR_RNG, NULL)); @@ -109,7 +109,7 @@ static void spapr_rng_instance_init(Object *obj) static void spapr_rng_realize(DeviceState *dev, Error **errp) { - sPAPRRngState *rngstate = SPAPR_RNG(dev); + SpaprRngState *rngstate = SPAPR_RNG(dev); if (rngstate->use_kvm) { if (kvmppc_enable_hwrng() == 0) { @@ -133,8 +133,8 @@ static void spapr_rng_realize(DeviceState *dev, Error **errp) } static Property spapr_rng_properties[] = { - DEFINE_PROP_BOOL("use-kvm", sPAPRRngState, use_kvm, false), - DEFINE_PROP_LINK("rng", sPAPRRngState, backend, TYPE_RNG_BACKEND, + DEFINE_PROP_BOOL("use-kvm", SpaprRngState, use_kvm, false), + DEFINE_PROP_LINK("rng", SpaprRngState, backend, TYPE_RNG_BACKEND, RngBackend *), DEFINE_PROP_END_OF_LIST(), }; @@ -152,7 +152,7 @@ static void spapr_rng_class_init(ObjectClass *oc, void *data) static const TypeInfo spapr_rng_info = { .name = TYPE_SPAPR_RNG, .parent = TYPE_DEVICE, - .instance_size = sizeof(sPAPRRngState), + .instance_size = sizeof(SpaprRngState), .instance_init = spapr_rng_instance_init, .class_init = spapr_rng_class_init, }; |