From nobody Sun May 19 04:34:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1707526851; cv=none; d=zohomail.com; s=zohoarc; b=ZKCgAlA5ZxVVQLQVMDOCOPA3tRr6hDWDsYLYmynO9lPtbtMNc8ezIbs7XkjrQINbPAktS1ObDki5Qr3Bw4Kls8oo5xjIPJtl4kE32zUfbGregRJwP6Qp9Nnam6LDHqEyqELPcJlm+2M6Y7rC67iJFxyw+nl7+9lB+Z5AiDp+hMA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707526851; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YskGeiggx3rWNLAmM+GyDtkQo//Orj69UVDpnT8Qv9M=; b=FgR7NYDSLqmhEdzPRWw3t0Qxr5x9KOQnfGTVFDkEuvVEzq6b5nYyuxCpN2vo2KdNisBW0IIvlt/vb6W7RJV0O+7NSfwJRBs0zoAiONW4nIny4rtyoCPSAeRc0B0OuzQBGuGlw3UbRS6x00UKu1TNbSC8nRqx+Khyz0uOOnqdlsc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1707526851110648.6631666011688; Fri, 9 Feb 2024 17:00:51 -0800 (PST) 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 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-Outflank-Mailman: Message body and most headers restored to incoming version 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 X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1707526852171100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3Dxen-devel&m=3D169828285627163 I think now with this series, the impact of Rule 14.4 is clearer: https://marc.info/?l=3Dxen-devel&m=3D170194257326186 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. =20 + * - `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. =20 while(0) and while(1) and alike are allowed. =20 + * - `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.=20 =20 + * - `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 - =20 + * - `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