From patchwork Mon Sep 24 18:08:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 186493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0DCE42C008D for ; Tue, 25 Sep 2012 04:08:34 +1000 (EST) Received: from localhost ([::1]:39611 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGD56-0003GG-23 for incoming@patchwork.ozlabs.org; Mon, 24 Sep 2012 14:08:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGD4x-0003Fd-RE for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:08:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGD4s-00068W-Jg for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:08:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGD4s-00068C-B8 for qemu-devel@nongnu.org; Mon, 24 Sep 2012 14:08:18 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8OI8GAZ008662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Sep 2012 14:08:17 -0400 Received: from bling.home (ovpn-113-153.phx2.redhat.com [10.3.113.153]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8OI8Glq030791; Mon, 24 Sep 2012 14:08:16 -0400 From: Alex Williamson To: qemu-devel@nongnu.org Date: Mon, 24 Sep 2012 12:08:16 -0600 Message-ID: <20120924175746.15361.32976.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: mst@redhat.com Subject: [Qemu-devel] [PATCH] CODING_STYLE: Define how to handle acronyms in CamelCase X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. + 4. Block structure Every indented statement is braced; even if the block contains just one