From: David Gibson <david@gibson.dropbear.id.au>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: groug@kaod.org, aik@ozlabs.ru, agraf@suse.de, lvivier@redhat.com,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] spapr: Use CamelCase properly
Date: Thu, 7 Mar 2019 16:21:49 +1100 [thread overview]
Message-ID: <20190307052149.GP7722@umbus.fritz.box> (raw)
In-Reply-To: <c1c9ba97-f80d-d61d-d5c8-9d909951da01@kaod.org>
[-- Attachment #1: Type: text/plain, Size: 2676 bytes --]
On Wed, Mar 06, 2019 at 08:22:51AM +0100, Cédric Le Goater wrote:
> Hello,
>
> On 3/6/19 5:38 AM, David Gibson wrote:
> > 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
> > unreadable clusters of capital letters, and means they don't appear to 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.
>
> +1
>
> > We also rename VIOsPAPR* to SpaprVio*, the less natural reverse ordering
> > was only there in the first place to mitigate the capital-letter cluster
> > of "sPAPRVIO".
>
> Could we remove the Device prefix ? I don't find it very useful.
[Aside: ITYM "suffix"]
>
> SpaprVioVtyDevice
> SpaprVioVlanDevice
Done.
> SpaprVioDevice
I'll leave this one. "SpaprVio" doesn't really make grammatical
sense, and "SpaprVioDevice" works in analogy with, say, PCIDevice.
>
> > 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>
>
> I have spotted dromedaries :
>
> typedef struct SpaprDRConnector
I've changed this to SpaprDrc. Shorter and makes it clearer that
these are the same things as the "DRC"s we reference elsewhere.
> typedef struct SpaprDRCPhysical
Changed to SpaprDrcPhysical
>
> Could we get rid of the 'State' prefix ? It does not add much to the name
> and usually the associated macros remove it.
True, but it is a common qemu pattern, so I think I'll leave these for now.
> SpaprRngState
> SpaprPhbState
> SpaprRtcState
> SpaprDimmState
> SpaprMachineState
> SpaprCpuState
>
> It would be good to reverse the xics filenames also.
I'm not really sure what you mean by that, and in any case I don't
think it's really in scope for this patch.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-03-07 5:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 4:38 [Qemu-devel] [RFC] spapr: Use CamelCase properly David Gibson
2019-03-06 7:22 ` Cédric Le Goater
2019-03-07 5:21 ` David Gibson [this message]
2019-03-07 6:18 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190307052149.GP7722@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=clg@kaod.org \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).