Received: by 10.213.65.68 with SMTP id h4csp1278304imn; Wed, 14 Mar 2018 15:22:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELuQR0Fbbe9NC1AM8kLNdKRQ1ke8u09zoQv/MJls5i+H+W6JFj/8Dv2hd62Htocg0M4XHb6d X-Received: by 2002:a17:902:7007:: with SMTP id y7-v6mr5054322plk.275.1521066176384; Wed, 14 Mar 2018 15:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521066176; cv=none; d=google.com; s=arc-20160816; b=Gr2NLL9kj4pLwpo4ZYih5pLHIvVMhDCYRbXJTP8mvqnFkwkATaHHooc3kFwZm/z/3k wB7TMWS2UYePS+a4FPBa0eXA4LJFLAh9pUtXK6qIaP05EkkOHE5C5P1VWyENNjpnG/6D jjBIImfAJMGXFz0cEmiW/ANeTFYzLIe0Fc6/N+zcUapl0Dwis+04BDeSG9mboqdQWNXp eFC8C7EpmdokbEhTHZT96VPW0Bl3QUsO7PwVAUYxMDwJ1p5nY/hY/R/nG4tFR7zg8zs6 C7NoXBKrdbefyFuRG3a11C7vfK/KuYqgJmZfwZGfv21vKeABoSaCGPTzf/vwmxv8TIcW jobg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=89kTa8VQ5DRET0MmOF9ptQOpStyPAAPaGP7QJR5wQOs=; b=YrN9dJkYQcRJqmL5y0KL3kEHncru9COvGISoqivgNjDLr9EZZYVjLRQpg1ngJbxHpl RYLRVDRIe4Fa5giZU3/kCMV+5S8HcPvECTKBs8Ib5Zu9kl2zMBQpO947Wo4FFfxptTuC xMQwoB0SGvlSgt6InIvmQdxUeJlD/Q9P3gNlJaHAoeokLxfkA5nGCxqW1FTjZ83nHalU LjaL+6j6/0CtlCV6C0eoBspuEvdS24dLOlZofOwuUzx9NTb5QzSAb1gDJO0m8BXvV7+e FWsHluyIq4Rn/LrLwX7exr0iNTkbdEMCJ07Vk+TekEGC3rPOSuy3kZr08B6AfuS4qUjS g+RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Kc7hB76I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l69si2757469pfk.180.2018.03.14.15.22.41; Wed, 14 Mar 2018 15:22:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=Kc7hB76I; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523AbeCNWVq (ORCPT + 99 others); Wed, 14 Mar 2018 18:21:46 -0400 Received: from mail-by2nam03on0074.outbound.protection.outlook.com ([104.47.42.74]:26976 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbeCNWVo (ORCPT ); Wed, 14 Mar 2018 18:21:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=89kTa8VQ5DRET0MmOF9ptQOpStyPAAPaGP7QJR5wQOs=; b=Kc7hB76IPshGkOieir2APhMbCAXfZK4RgRj8SSDV3EQKkG9qzw/WPHbL1qZWxL6yjJuQGl2FdYyrZZ/G72isdGKUlrj9/Al08LMy7XBcfN70SIK1YGL163xcQJ9Yb3UbBrMWm9Y7cCe4/ezdBbdhdE37IbiKTTJci2YzxhD1xjA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Received: from [127.0.1.1] (165.204.78.1) by SN1PR12MB0702.namprd12.prod.outlook.com (2a01:111:e400:c42a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 14 Mar 2018 22:21:41 +0000 Subject: [PATCH] Documentation/CodingStyle: Add an example for braces From: Gary R Hook To: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, corbet@lwn.net Date: Wed, 14 Mar 2018 17:21:38 -0500 Message-ID: <152106609844.18780.6843553697430932588.stgit@taos> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR07CA0044.namprd07.prod.outlook.com (2603:10b6:3:16::30) To SN1PR12MB0702.namprd12.prod.outlook.com (2a01:111:e400:c42a::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d42a67a2-da6d-4fd6-3737-08d589f9f68a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:SN1PR12MB0702; X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0702;3:ClxpLY6NkKiR7OoWFp8xsMGUE2GI+Oy4KfzqTv263o+VKtHUBm5kPKg9eVWopKmVxnT7t1+1BIFxVOx8qEZHDtEAh3h0nmEmU5kZsPGU8NlZLNj0qhEaI1TncK52IGtpmLNWTJVrbAHurva9KysX6ItOTIA1gqnwfT98rPEG0niiJEqZIW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LF6+grEf+9clfP+J7ZRYT+cdsOJgzBY4eV+JnlfmQPt0C9BMirBBRaR+0Bx+87PoX1s6H/hDkWBSLPK4xvHfea2BPz9QBASUsluAdIfxdwniToD9AAX7odPUx8k66KitxImgclQnzJ+AuNqFivh2FinLX5MF1+WDv1QdXmN9gBUS5JCAIWXYFvlMenNfdn9D;4:hY0/oxVOhTI1CNk6ePj08U1u6EHrCt6pnI0BEWc02LbK+0qacrqvgajEljyBduZH3xqEbDXpqjkaWA5VFMnZTGeLRjxgYUPmOwiL99wPRKzzdNPEmU+x3uQGQxdqU+XTRu/hoTU/BnZumPnldwohoS+kTl4iuHkGbrwndhBPQuBgcZVJGy3vJrgbwPB+zk5CNNC/r078rld7M4NcpM7mTFj3FCkIPDsQ7GQd0Xg9Fj6b6HmAY0IuZkRiXqWw6v0nsKF/+WIPdvnwWBAcCPaoZgQAklY/EkN/UWo9uE6Wfvo5/eFswMH9N8eKFGCa6JH/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011);SRVR:SN1PR12MB0702;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB0702; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(7916004)(376002)(346002)(396003)(39860400002)(366004)(39380400002)(199004)(189003)(103116003)(316002)(478600001)(6666003)(7736002)(33716001)(16526019)(6916009)(230700001)(105586002)(72206003)(5660300001)(6486002)(97736004)(8676002)(81156014)(81166006)(8936002)(50466002)(33896004)(25786009)(6116002)(9686003)(4326008)(53936002)(186003)(23676004)(77096007)(305945005)(386003)(2486003)(2906002)(16576012)(58126008)(86362001)(68736007)(3846002)(1857600001)(47776003)(2361001)(2351001)(26005)(66066001)(106356001)(52116002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB0702;H:[127.0.1.1];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIwNzAyOzIzOk00N1N2TjlwMVJCWVdUL1AvdzQxUWFmZWI0?= =?utf-8?B?ZUpqQU1QQll1QXY3ekYrdVJ5T3dNS3VpU1JudlZrNG45anB0bVpzQVNzSVM1?= =?utf-8?B?b1BueHNjZXZVTmZGU0xDZ0s1NDN6ZDE2cnNoVi9yWGE5dUovZ2s0TzdaalFD?= =?utf-8?B?Q3NJQUY1QllRaFVDL3pQUTFrM3V5cDRuR3hEdTR4ZGMrWlc3QU16aEMrOG11?= =?utf-8?B?U2RaYkg3SXI1V25ENVdqZGI5ZzNrbWp5azJlSk42eFUzRldZdW1pN1FXVldi?= =?utf-8?B?a0R2ZlFoaENXYjFUajRiWFZ3dStta0Z0WHpIaTd6K3cwZi9NNEQ4ZXArUTdh?= =?utf-8?B?R24rc1FteTM3eDVVNnFZWDJYV1ZKL3ZLUjd0d2RHYmZtcm13VlJmeEl6aG5C?= =?utf-8?B?OEFINkQxbElqTzllYnBwN1Zjc2xaTlBWdVZxK1owK0ZIZmZ3algvUkVCdklr?= =?utf-8?B?bzRRWTNZTG1aOXZ5ZUNrTjJXdXhwY1JINjdhaHEwK3JkaUwva1duL0xobjZ6?= =?utf-8?B?ejdxOU1MZERlRWpzNVlrdWcySmM1UGlmejhVNDVmUkkyTlhMZzJvZG0xK01T?= =?utf-8?B?dnpiRXpDb1FDNU9EcGFETTljR1VCZG5hTno5bk4wNllGYnJpQk16cmJtbStU?= =?utf-8?B?bDhtYTRERkJRVDB4Ynd2VkdnOXlPSkF5TDlCMVRTVVNDZ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EqZq1T2Z5WORVs7HNqDWoEP0HdrlyBgGVzYQ1w80YRaGGcJ9xpeRSmhKujDLotRGYf4UG1HrnFFgHjOM4mvTeOM2LrC92ZZvBLK/AVMbQK7DzgbLyA+ya1SYF1cWZYHSNmgYUN1mRNxLJO6/p0TNjMypkdPtKsR/I4f8thAU5aEIZxH9VQMJ9c0b8vH8jDTsBgmsKp52JbIA9uBAOnw3L1q2ZAu+GSexYVHRNCLy7WzZd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR12MB0702;20:grSLgxEgLA5srR0PPbMiO72q0QUnev+ESqrIavXFwFLIokMqtK3+c8dTP6kc5UJDc+6T778/nzdXHD8JvqzNhk8JvmyExvSTlPcTpjJQMhgPwk7FU1cwfqsRkUKXPkaO9FUV+nK9Ho4AqtToiIGE4B6DZPBwPZO9sv/XzgKELC3etkXFpy14rLWi6lQg1O0tOpgW9404g1xtQdr0rCVKYe9nWu1iGlJIQ6C6QTA88LrGGcJlgy0zQCmiL7y+bdIy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 22:21:41.5627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d42a67a2-da6d-4fd6-3737-08d589f9f68a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0702 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add another example of required braces when using a compound statement in a loop. Signed-off-by: Gary R Hook --- Documentation/process/coding-style.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst index a20b44a40ec4..d98deb62c400 100644 --- a/Documentation/process/coding-style.rst +++ b/Documentation/process/coding-style.rst @@ -200,6 +200,15 @@ statement; in the latter case use braces in both branches: otherwise(); } +Also, use braces when a loop contains more than a single simple statement: + +.. code-block:: c + + while (condition) { + if (test) + do_something(); + } + 3.1) Spaces ***********