From nobody Sun May 12 18:12:00 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=1701994225; cv=none; d=zohomail.com; s=zohoarc; b=Qi2uF17bH1YWAhAhqxzauc8BOa8zYMOoZsYuzg0HMCDMcEZ4oeLMiaITs2Gc+kKjGRt99hEma5VbkEa3MNPOZHg5YGssGCYeo7cOojHyrZxbAmtZnuSxkKH3xKUHKkvPzpY2td2LItFY+45wwG9sABdqqBg8IBj2hGoJoltEVeg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701994225; 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=3N01ON+EpUa1GHoVoIQsi6DMS0kj8m4V65Xbr7YViDA=; b=drFuuRwV8IELUEz1Q5NE1Aq6XnEymMqL/c6uYEfmw8NiH0geUMjKtK1hQx9stpHxyFCIqEfEJ+1OKjDGd3F785wINqAChFQaESAaXzqRRmbZDTvLxsvMfxXI8kDjRpq4O3kt2fUS8I/TR9ryh9sqpPNrbs9FVR9vFXDzvLX1ChU= 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 1701994225521450.01843380208527; Thu, 7 Dec 2023 16:10:25 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.650262.1015583 (Exim 4.92) (envelope-from ) id 1rBORV-0001kW-TY; Fri, 08 Dec 2023 00:10:09 +0000 Received: by outflank-mailman (output) from mailman id 650262.1015583; Fri, 08 Dec 2023 00:10:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBORV-0001kP-Pb; Fri, 08 Dec 2023 00:10:09 +0000 Received: by outflank-mailman (input) for mailman id 650262; Fri, 08 Dec 2023 00:10:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rBORU-0001kJ-Ms for xen-devel@lists.xenproject.org; Fri, 08 Dec 2023 00:10:08 +0000 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2347ecd3-955e-11ee-9b0f-b553b5be7939; Fri, 08 Dec 2023 01:10:06 +0100 (CET) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 44C57CE1F68; Fri, 8 Dec 2023 00:10:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C167C433C7; Fri, 8 Dec 2023 00:09:58 +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: 2347ecd3-955e-11ee-9b0f-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701994199; bh=tHrOx/qdz5H68a9f3qKTXOuNrb27A8wS5L+D0AyS1w4=; h=Date:From:To:cc:Subject:From; b=KmzruPsDw4ZSrIFphB1b0p1x7OF2SQVrqRRWzIAqJduSDSEcE5U9i1VKqrNhbasK/ haB7hHjx/5iWn7Gs33VcTZMJoT6zVNTArAyGzka+XaCseAmh0pBSpRya6BNDEaJsEW VUcwB/w8ziMPGY9DPiM9j0LTwFdFuVdxMzJQ7J1XOiv6OGq8PXdPzMiUopN0O3lGRj USz9E/5ijPF3MWZOpEex/WkrqaV3XaIxO1O7LfEO5AOfcB+7GW301cBKFg62Bd+LEk GJq90VHIclAlDmlrDUgz9P6R+s9h3NRtfVxCG5yxJc2p/rbjffGg/aLR/MlCJXzVSX Grv8plJbiMyGw== Date: Thu, 7 Dec 2023 16:09:56 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: 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 v2] docs/misra/rules.rst: add more 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: 1701994227749100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the rules accepted in the last three MISRA C working group meetings. Signed-off-by: Stefano Stabellini Acked-by: Jan Beulich --- Changes in v2: - remove 17.1 for now, to be a separate patch - add a clarification comment for 17.7 --- docs/misra/rules.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 75921b9a34..2b570af0e0 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -462,6 +462,13 @@ maintainers if you want to suggest a change. =20 while(0) and while(1) and alike are allowed. =20 + * - `Rule 16.3 `_ + - Required + - An unconditional break statement shall terminate every + switch-clause + - In addition to break, also other flow control statements such as + continue, return, goto are allowed. + * - `Rule 16.7 `_ - Required - A switch-expression shall not have essentially Boolean type @@ -478,12 +485,27 @@ maintainers if you want to suggest a change. have an explicit return statement with an expression - =20 + * - `Rule 17.5 `_ + - Advisory + - The function argument corresponding to a parameter declared to + have an array type shall have an appropriate number of elements + - + * - `Rule 17.6 `_ - Mandatory - The declaration of an array parameter shall not contain the static keyword between the [ ] - =20 + * - `Rule 17.7 `_ + - Required + - The value returned by a function having non-void return type + shall be used + - Please beware that this rule has many violations in the Xen + codebase today, and its adoption is aspirational. However, when + submitting new patches please try to decrease the number of + violations when possible. + * - `Rule 18.3 `_ - Required - The relational operators > >=3D < and <=3D shall not be applied to = objects of pointer type except where they point into the same object @@ -498,6 +520,11 @@ maintainers if you want to suggest a change. instances where Eclair is unable to verify that the code is valid in regard to Rule 19.1. Caution reports are not violations. =20 + * - `Rule 20.4 `_ + - Required + - A macro shall not be defined with the same name as a keyword + - + * - `Rule 20.7 `_ - Required - Expressions resulting from the expansion of macro parameters @@ -506,6 +533,13 @@ maintainers if you want to suggest a change. as function arguments, as macro arguments, array indices, lhs in assignments =20 + * - `Rule 20.9 `_ + - Required + - All identifiers used in the controlling expression of #if or + #elif preprocessing directives shall be #define'd before + evaluation + - + * - `Rule 20.13 `_ - Required - A line whose first token is # shall be a valid preprocessing --=20 2.25.1