From patchwork Tue Feb 28 06:44:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 733334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vXTqg3K2vz9sDg for ; Tue, 28 Feb 2017 17:55:43 +1100 (AEDT) Received: from localhost ([::1]:59007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibhE-0008NL-SJ for incoming@patchwork.ozlabs.org; Tue, 28 Feb 2017 01:55:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibfq-00079b-T7 for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:54:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cibfn-0005sr-Qk for qemu-devel@nongnu.org; Tue, 28 Feb 2017 01:54:14 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:37841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cibfn-0005sV-IW; Tue, 28 Feb 2017 01:54:11 -0500 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 8219A43567; Tue, 28 Feb 2017 09:54:10 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id D1D563DE; Tue, 28 Feb 2017 09:45:01 +0300 (MSK) Received: (nullmailer pid 19625 invoked by uid 1000); Tue, 28 Feb 2017 06:44:59 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Tue, 28 Feb 2017 09:44:48 +0300 Message-Id: <25ac5bbec43973e9b97a454e55fd307ef9db1320.1488264243.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 05/14] CODING_STYLE: Mention preferred comment form X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Our defacto coding style strongly prefers /* */ style comments over the single-line // style, and checkpatch enforces this, but we don't actually document this. Mention it in CODING_STYLE. Suggested-by: Thomas Huth Signed-off-by: Peter Maydell Reviewed-by: Markus Armbruster Reviewed-by: Fam Zheng Reviewed-by: Laurent Vivier Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- CODING_STYLE | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CODING_STYLE b/CODING_STYLE index f53180b..2fa0c0b 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -116,3 +116,10 @@ if (a == 1) { Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read. Besides, good compilers already warn users when '==' is mis-typed as '=', even when the constant is on the right. + +7. Comment style + +We use traditional C-style /* */ comments and avoid // comments. + +Rationale: The // form is valid in C99, so this is purely a matter of +consistency of style. The checkpatch script will warn you about this.