From nobody Wed May 15 02:00:49 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=1692408288; cv=none; d=zohomail.com; s=zohoarc; b=BBEOPnJrK4q0TMVYFZrEPY1OZZGIB4AcP7NGZJrr2kr1ny0KFN3FzsJ+WI3WgHba0qaiAsGR6U499q3Xrp4aA824NLkfDbJMlvVvRqfv/2gX+l83usiB0QVk48vXTU9cRqy60ZjfF+qSFY55DSqFqS+jz4fhxkPK8pMQMSkedCc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692408288; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=jc2wKWxlhvaUsIICJ877t1nT42APPjR47HJh1eVy/0w=; b=XJGFySLz16ujiP7FDrhMkZBTKiKP2sacS2P/+kbBSPF9oaqqWFr+0Yb6Bpc+d38tjl0vOnYyw5oZ67sYD2kAjRF9FjL4HrgH6yMACtqQt24JPlUH5+PbjAA2aNwrGLhyEP7tFlmFP6xbTnhXN76JrjSeaBnou1qI+ypRZJkBP+Q= 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 1692408288660428.1252732821481; Fri, 18 Aug 2023 18:24:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.586843.918133 (Exim 4.92) (envelope-from ) id 1qXAhP-00065H-0D; Sat, 19 Aug 2023 01:24:19 +0000 Received: by outflank-mailman (output) from mailman id 586843.918133; Sat, 19 Aug 2023 01:24:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qXAhO-00065A-Tp; Sat, 19 Aug 2023 01:24:18 +0000 Received: by outflank-mailman (input) for mailman id 586843; Sat, 19 Aug 2023 01:24:18 +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 1qXAhO-00064o-Cf for xen-devel@lists.xenproject.org; Sat, 19 Aug 2023 01:24:18 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1c6497c2-3e2f-11ee-877e-cb3800f73035; Sat, 19 Aug 2023 03:24:16 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 28AC361B69; Sat, 19 Aug 2023 01:24:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52016C433C7; Sat, 19 Aug 2023 01:24:13 +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: 1c6497c2-3e2f-11ee-877e-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692408254; bh=me7zOvwgCZOIaCP/W20OevzMLC8uORPtHBEeZ9iyYpY=; h=From:To:Cc:Subject:Date:From; b=PndH/HpZ0fyqVRyO6rB9171Y7bnL5hbkoIIq8v62nNdmYh39LwFkCk7U2ReTa8/Xc XI7svsjQQL/FeSrMzI5pvSjHNkU8bH3fNCKHF7OuhZAXY39F+ssVdTiZXo7oL4Nz7m b+ZL4/MVGAj45cs1XQU2Onu4A1CyyZ2LR9JgoLTS4Yu/TGqbXVHxDELHEmH/qDX/8c SXyymYxO7J3kiBBLf+Rip2+T6AX+ac8m7W7qCdtIJml6no/HTnxjOznbeMCQaHzMtT qPrRglEpXe0Fwe81jVr+lOWfb8+VP6oNC+4ci+eitnUbusSLyJ9tz1pFrGeELntg+Q RrCUTkPcLYDqw== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org, bertrand.marquis@arm.com, nicola.vetrini@bugseng.com, Stefano Stabellini Subject: [PATCH] docs/misra: add exceptions to rules Date: Fri, 18 Aug 2023 18:24:10 -0700 Message-Id: <20230819012410.1754839-1-sstabellini@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @kernel.org) X-ZM-MESSAGEID: 1692408291022100001 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini During the discussions that led to the acceptable of the Rules, we decided on a few exceptions that were not properly recorded in rules.rst. Other times, the exceptions were decided later when it came to enabling a rule in ECLAIR. Either way, update rules.rst with appropriate notes. Signed-off-by: Stefano Stabellini --- Note that there might be more to add, but the below look correct to me --- docs/misra/rules.rst | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 8f0e4d3f25..ecbb04da96 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -59,7 +59,8 @@ maintainers if you want to suggest a change. - Required - Precautions shall be taken in order to prevent the contents of a header file being included more than once - - + - Files that are intended to be included more than once do not need to + conform to the directive (e.g. autogenerated or empty header files) =20 * - `Dir 4.11 `_ - Required @@ -106,7 +107,23 @@ maintainers if you want to suggest a change. * - `Rule 2.1 `_ - Required - A project shall not contain unreachable code - - + - The following are allowed: + - Invariantly constant conditions (e.g. while(0) { S; }) + - Switch with a controlling value incompatible with labeled + statements + - Functions that are intended to be never referenced from C + code, or are referenced in builds not under analysis (e.g. + 'do_trap_fiq' for the former and 'check_for_unexpected_msi' + for the latter) + - Unreachability caused by the following macros/functions is + deliberate: BUG, assert_failed, ERROR_EXIT, ERROR_EXIT_DOM, + PIN_FAIL, __builtin_unreachable, panic, do_unexpected_trap, + machine_halt, machine_restart, machine_reboot, + ASSERT_UNREACHABLE + - asm-offsets.c, as they are not linked deliberately, because + they are used to generate definitions for asm modules + - pure declarations (i.e. declarations without + initialization) are safe, as they are not executed =20 * - `Rule 2.6 `_ - Advisory @@ -117,7 +134,7 @@ maintainers if you want to suggest a change. - Required - The character sequences /* and // shall not be used within a comment - - + - Comments containing hyperlinks inside C-style block comments are sa= fe =20 * - `Rule 3.2 `_ - Required @@ -167,7 +184,7 @@ maintainers if you want to suggest a change. * - `Rule 5.6 `_ - Required - A typedef name shall be a unique identifier - - + - BOOLEAN, UINT{8,32,64} and INT{8,32,64} are allowed =20 * - `Rule 6.1 `_ - Required @@ -183,7 +200,10 @@ maintainers if you want to suggest a change. * - `Rule 7.1 `_ - Required - Octal constants shall not be used - - + - Usage of the following constants is safe, since they are given + as-is in the inflate algorithm specification and there is + therefore no risk of them being interpreted as decimal constants: + ^0(007|37|070|213|236|300|321|330|331|332|333|334|335|337|371)$ =20 * - `Rule 7.2 `_ - Required @@ -239,13 +259,16 @@ maintainers if you want to suggest a change. - Required - All declarations of an object or function shall use the same names and type qualifiers - - + - The type ret_t is deliberately used and defined as int or long + depending on the architecture =20 * - `Rule 8.4 `_ - Required - A compatible declaration shall be visible when an object or function with external linkage is defined - - + - Allowed exceptions: asm-offsets.c (definitions for asm modules + not called from C code), gcov_base.c (definitions only used in + non-release builds) =20 * - `Rule 8.5 `_ - Required @@ -369,7 +392,9 @@ maintainers if you want to suggest a change. - Required - Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses - - + - Extra parentheses are not required when macro parameters are used + as function arguments, as macro arguments, array indices, lhs in + assignments =20 * - `Rule 20.13 `_ - Required --=20 2.25.1