From patchwork Sat Feb 10 01:00:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13552019 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9174C48297 for ; Sat, 10 Feb 2024 01:00:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.678888.1056464 (Exim 4.92) (envelope-from ) id 1rYbjJ-0005Qx-AN; Sat, 10 Feb 2024 01:00:29 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 678888.1056464; Sat, 10 Feb 2024 01:00:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYbjJ-0005QD-6o; Sat, 10 Feb 2024 01:00:29 +0000 Received: by outflank-mailman (input) for mailman id 678888; Sat, 10 Feb 2024 01:00:27 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rYbjH-0004Xu-CB for xen-devel@lists.xenproject.org; Sat, 10 Feb 2024 01:00:27 +0000 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c5313440-c7af-11ee-8a4b-1f161083a0e0; Sat, 10 Feb 2024 02:00:25 +0100 (CET) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 91A11CE21B7; Sat, 10 Feb 2024 01:00:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7390CC433F1; Sat, 10 Feb 2024 01:00:20 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c5313440-c7af-11ee-8a4b-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707526821; bh=JTkq67hnvWdxWDQL1xzqnFjH30QdB2GW5uVXDakbOlo=; h=Date:From:To:cc:Subject:From; b=PgYseM3ZYlYverGvoQSJ9lZ/maULAmoWGP093b82AO+lCZMLGDEgZ282jRBgWwqeY amdTHTJRhxsiI8hJf1qA6jrFUwuYrxf54Xb6ZDGDI3Yah5Ja2XhkG8t39MMzPzHhrK ztbEB7xuPRfWZCs1Su9ozvQfO0kmP+c/cGnwNFfxvMiBsIW6E2QAGN/sRKj1PA+FZr rjILcporlY9biqyWTCujDEyHaQU81qQbwydTcf9JNV6+yLSzZEHOtO8m3lpXcqDD+O 4cY9SFaLBm96SV9+iVRTItHSTqrsBeOlPODk1VMK7+HE7aUPZeCGatey8gqn6ig8y6 WgCHcAhiz4KeA== Date: Fri, 9 Feb 2024 17:00:19 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, andrew.cooper3@citrix.com, jbeulich@suse.com, george.dunlap@citrix.com, julien@xen.org, sstabellini@kernel.org, bertrand.marquis@arm.com, roger.pau@citrix.com, roberto.bagnara@bugseng.com, federico.serafini@bugseng.com Subject: [PATCH v1] docs/misra/rules.rst: catch up with accepted rules Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Update docs/misra/rules.rst to reflect the MISRA C rules accepted in the last couple of months. Signed-off-by: Stefano Stabellini --- In the notes section I added some info about the deviations, but in any case the appropriate info will also be added to deviations.rst, safe.json, etc. I also added Rule 14.4, which is older, but when I first tried to add it to rules.rst, Jan had a question I couldn't reply clearly: https://marc.info/?l=xen-devel&m=169828285627163 I think now with this series, the impact of Rule 14.4 is clearer: https://marc.info/?l=xen-devel&m=170194257326186 diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 182331089d..0cb87ebc35 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -181,6 +181,12 @@ maintainers if you want to suggest a change. headers (xen/include/public/) are allowed to retain longer identifiers for backward compatibility. + * - `Rule 5.5 `_ + - Required + - Identifiers shall be distinct from macro names + - Clashes between function-like macros and non-callable entities + are allowed. The pattern #define x x is also allowed. + * - `Rule 5.6 `_ - Required - A typedef name shall be a unique identifier @@ -462,6 +468,13 @@ maintainers if you want to suggest a change. while(0) and while(1) and alike are allowed. + * - `Rule 14.4 `_ + - Required + - The controlling expression of an if-statement and the controlling + expression of an iteration-statement shall have essentially + Boolean type + - + * - `Rule 16.3 `_ - Required - An unconditional break statement shall terminate every @@ -478,6 +491,12 @@ maintainers if you want to suggest a change. adhere to Rule 16.2 would result in increased complexity and maintenance difficulty, and could potentially introduce bugs. + * - `Rule 16.6 `_ + - Required + - Every switch statement shall have at least two switch-clauses + - Single-clause switches are allowed when they do not involve a + default label. + * - `Rule 16.7 `_ - Required - A switch-expression shall not have essentially Boolean type @@ -554,6 +573,13 @@ maintainers if you want to suggest a change. evaluation - + * - `Rule 20.12 `_ + - A macro parameter used as an operand to the # or ## operators, + which is itself subject to further macro replacement, shall only + be used as an operand to these operators + - Required + - Variadic macros are allowed to violate the rule. + * - `Rule 20.13 `_ - Required - A line whose first token is # shall be a valid preprocessing