From nobody Sun May 19 14:14:28 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=1693357228; cv=none; d=zohomail.com; s=zohoarc; b=Bq+hYzX2Dd2cCMqNcH8KYEb48p3MukEeYaXCMwdHJ/2zWNjK8ooyNhuT8RlV85Ud8r0Gzf7aXQoTh8HojABuJA+QJKUtbO3Q8RvHqeYXgsI5BEpHp1drHZt3pHMUlPbE8RO3gDNoUAc0wHT7G5YgYezXsgXMqb0w7YjRM8+JdAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1693357228; 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=jS2i5ptjGvzLu+aO5JyTt0AmYWH4nynu46iqaWuL6Ds=; b=FaRJxSnAw918oIRlS8WzkCJyxSHI/cM1Y47sXM9XrusX8S0wF8HYhGqqpsV8k2P8V0LdsNLSN7iXZvki+USbjZHPOQRMKaXBCcywNIv5F2NPGQCzIBy+UTLCB5TXmVawBbHgPD8hTepEdcwpyI6kO5MfK+EME4aDhEmo7q4H1FI= 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 1693357228528631.4986617824; Tue, 29 Aug 2023 18:00:28 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.592653.925434 (Exim 4.92) (envelope-from ) id 1qb9Ys-0002IA-HH; Wed, 30 Aug 2023 00:59:58 +0000 Received: by outflank-mailman (output) from mailman id 592653.925434; Wed, 30 Aug 2023 00:59:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qb9Ys-0002I3-ET; Wed, 30 Aug 2023 00:59:58 +0000 Received: by outflank-mailman (input) for mailman id 592653; Wed, 30 Aug 2023 00:59:58 +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 1qb9Ys-0002Hx-39 for xen-devel@lists.xenproject.org; Wed, 30 Aug 2023 00:59:58 +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 88aaa359-46d0-11ee-8783-cb3800f73035; Wed, 30 Aug 2023 02:59:56 +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 B5A1062AB5; Wed, 30 Aug 2023 00:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A25A3C433C9; Wed, 30 Aug 2023 00:59:52 +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: 88aaa359-46d0-11ee-8783-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693357194; bh=0C+rFqD5HpHjRZq31l0hOmN7L4Q5TeDSQyVi9ZvzwW8=; h=From:To:Cc:Subject:Date:From; b=GTDUAHejpso3bzwvQdS3tfmz0vAJhneXD3ZdiQCVcfEjXaxQ70YdQJz2DKueL6zJ/ c9OTCGbyPjQTsgekjKc8M4kq/HOkcKKeNfJ1FsGvlgvVLCtFJbgHzbl3cCtbefQXd/ dMI2H5j8XnhUe408ufjxr2xjmgSYnQINt9HtAqDldzzYWSX+17FmSuFcNhWg/Nj7NI ZziTn4Jg499TL0WQ7mqGS7pL7wYSY7MvMmXxaiQgazsAuDyOjG3rwa+UK2dgJf65c0 PfC9CdQpi0bYE/RgsJDKarHl8GzMZyTnwpyzeu6++HqqapefHhmuucSTFI30S3+vtC gOFqtTAZ2UQ9w== From: Stefano Stabellini To: xen-devel@lists.xenproject.org Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, julien@xen.org, sstabellini@kernel.org, george.dunlap@citrix.com, bertrand.marquis@arm.com, nicola.vetrini@bugseng.com, roberto.bagnara@bugseng.com, Stefano Stabellini Subject: [PATCH] docs/misra: add 14.3 and 14.4 Date: Tue, 29 Aug 2023 17:59:50 -0700 Message-Id: <20230830005950.305085-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: 1693357229523100001 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Add 14.3, with a project-wide deviations on if statements. Add 14.4, clarifying that implicit conversions of integers, chars and pointers to bool are allowed. Also take the opportunity to clarify that parameters of function pointer types are expected to have names (Rule 8.2). Signed-off-by: Stefano Stabellini --- docs/misra/rules.rst | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index db30632b93..6cde4feeae 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -234,7 +234,7 @@ maintainers if you want to suggest a change. * - `Rule 8.2 `_ - Required - Function types shall be in prototype form with named parameters - - + - Function pointer types shall have named parameters too. =20 * - `Rule 8.3 `_ - Required @@ -332,6 +332,24 @@ maintainers if you want to suggest a change. - A loop counter shall not have essentially floating type - =20 + * - `Rule 14.3 `_ + - Required + - Controlling expressions shall not be invariant + - Due to the extensive usage of IS_ENABLED, sizeof compile-time + checks, and other constructs that are detected as errors by MISRA + C scanners, managing the configuration of a MISRA C scanner for + this rule would be unmanageable. Thus, this rule is adopted with + a project-wide deviation on 'if' statements. The rule only + applies to while, for, do ... while, ?:, and switch statements. + + * - `Rule 14.4 `_ + - Required + - The controlling expression of an if statement and the controlling + expression of an iteration-statement shall have essentially + Boolean type + - Implicit conversions of integers, pointers, and chars to boolean + are allowed + * - `Rule 16.7 `_ - Required - A switch-expression shall not have essentially Boolean type --=20 2.25.1