From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THJqV-0004py-B9 for qemu-devel@nongnu.org; Thu, 27 Sep 2012 15:34:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THJqK-0006kR-3K for qemu-devel@nongnu.org; Thu, 27 Sep 2012 15:34:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THJqJ-0006jc-Qc for qemu-devel@nongnu.org; Thu, 27 Sep 2012 15:33:51 -0400 Message-ID: <1348774428.2320.218.camel@ul30vt.home> From: Alex Williamson Date: Thu, 27 Sep 2012 13:33:48 -0600 In-Reply-To: <87obks5tu1.fsf@codemonkey.ws> References: <20120924175746.15361.32976.stgit@bling.home> <87obks5tu1.fsf@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: Define how to handle acronyms in CamelCase List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, mst@redhat.com On Wed, 2012-09-26 at 16:59 -0500, Anthony Liguori wrote: > Alex Williamson writes: > > > When creating structure names in CamelCase, it's easy to have > > back-to-back capitals when using acronyms (ex. PCIINTxRoutingNotifier, > > QEMUSGList, VFIOINTx). In the worst case these can look like macros, > > but even adjoining a single, all-caps acronym makes it more difficult > > to interpret. For example, is PCIIntxRoutingNotifier sufficiently > > more clear? Mixing case, such as VFIOintx isn't truly CamelCase. > > Therefore let's abandon all-caps acronyms in CamelCase, resulting in > > PciIntxRoutingNotifier, QemuSgList, VfioIntx. > > > > Cc: Michael Tsirkin > > Signed-off-by: Alex Williamson > > --- > > > > This is an attempt to formalize and get agreement on name changes > > suggested for the vfio-pci driver. VFIO is very prone to these naming > > problems. I don't expect to do any massive code churn to correct > > these, but I will update vfio-pci to whatever outcome we decide and at > > least we'll have a reference rather than per maintainer policy. > > Thanks, > > > > Alex > > > > CODING_STYLE | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/CODING_STYLE b/CODING_STYLE > > index dcbce28..e45ed1a 100644 > > --- a/CODING_STYLE > > +++ b/CODING_STYLE > > @@ -53,6 +53,11 @@ and is therefore likely to be changed. > > When wrapping standard library functions, use the prefix qemu_ to alert > > readers that they are seeing a wrapped version; otherwise avoid this prefix. > > > > +When making use of acronyms in CamelCase only capitalize the first character > > +of the acronym. This promotes readability and clearly defines the start of > > +each word or acronym. For example, instead of PCIBAR, use PciBar. In place > > +of QEMUDMAList, use QemuDmaList. > > + > > I'd prefer not to do this. > > We do both within QEMU and I think that's fine. By choosing one vs. the > other we just create a lot of friction because now people have to > introduce structures that aren't consistent with the rest of the file. > > Either is fine IMHO. Fair enough, thanks, Alex