From patchwork Thu May 23 01:26:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13671202 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 8FEF1C25B78 for ; Thu, 23 May 2024 01:26:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.728001.1132712 (Exim 4.92) (envelope-from ) id 1s9xDj-0006aA-Fu; Thu, 23 May 2024 01:26:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 728001.1132712; Thu, 23 May 2024 01:26:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1s9xDj-0006a3-Ck; Thu, 23 May 2024 01:26:15 +0000 Received: by outflank-mailman (input) for mailman id 728001; Thu, 23 May 2024 01:26:14 +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 1s9xDi-0006Zx-AL for xen-devel@lists.xenproject.org; Thu, 23 May 2024 01:26:14 +0000 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6f8d74eb-18a3-11ef-b4bb-af5377834399; Thu, 23 May 2024 03:26:11 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7F1E462C1B; Thu, 23 May 2024 01:26:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11049C2BBFC; Thu, 23 May 2024 01:26:07 +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: 6f8d74eb-18a3-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716427569; bh=YR3KJ3TmhDushqp+LY+DYIddrHRhTOOrKUSPZFMBa8I=; h=Date:From:To:cc:Subject:From; b=DgDb/QOwpW21LsdJspqBdV9yPP9Wn9O6dIKR7OjphMV7/b3BVG/JBlNRxSDlGrz0p ZGQVvihkRRqdsff0CZFWd3P4jJcJ7jjHm/9U/ixlLhRs1mqSb6YUZlylKbN4Qgvch8 CzbPEgA4zVZInkDohYJ9na777Zzd7caGjmZw5qk3OuaWtXiRfQ8t8F8/zpVLDAYMM9 ysn5Mh/neZjmd3/Y72eSVhsw7qg+vmIbImFOgepXA1N7Oy1Mpb66wq8rIb9GkEGL41 2SX70LDKwE+RXjIWtFeDXiFECClbEYgIOTPb6SpGFqKIEy+zF/rJpcfsMFLqGsJfKD rLJ0UxXii5GSw== Date: Wed, 22 May 2024 18:26:07 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: andrew.cooper3@citrix.com, george.dunlap@citrix.com, jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com, bertrand.marquis@arm.com, roger.pau@citrix.com Subject: [PATCH] docs/misra: rules for mass adoption Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 This patch adds a bunch of rules to rules.rst that are uncontroversial and have zero violations in Xen. As such, they have been approved for adoption. All the ones that regard the standard library have the link to the existing footnote in the notes. Signed-off-by: Stefano Stabellini diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 80e5e972ad..d67c74a083 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -580,6 +580,11 @@ maintainers if you want to suggest a change. - The relational operators > >= < and <= shall not be applied to objects of pointer type except where they point into the same object - + * - `Rule 18.8 `_ + - Required + - Variable-length array types shall not be used + - + * - `Rule 19.1 `_ - Mandatory - An object shall not be assigned or copied to an overlapping @@ -589,11 +594,29 @@ 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. + * - `Rule 20.2 `_ + - Required + - The ', " or \ characters and the /* or // character sequences + shall not occur in a header file name + - + + * - `Rule 20.3 `_ + - Required + - The #include directive shall be followed by either a + or "filename" sequence + - + * - `Rule 20.4 `_ - Required - A macro shall not be defined with the same name as a keyword - + * - `Rule 20.6 `_ + - Required + - Tokens that look like a preprocessing directive shall not occur + within a macro argument + - + * - `Rule 20.7 `_ - Required - Expressions resulting from the expansion of macro parameters @@ -609,6 +632,12 @@ maintainers if you want to suggest a change. evaluation - + * - `Rule 20.11 `_ + - Required + - A macro parameter immediately following a # operator shall not + immediately be followed by a ## operator + - + * - `Rule 20.12 `_ - Required - A macro parameter used as an operand to the # or ## operators, @@ -651,11 +680,39 @@ maintainers if you want to suggest a change. declared - See comment for Rule 21.1 + * - `Rule 21.3 `_ + - Required + - The memory allocation and deallocation functions of + shall not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 21.4 `_ + - Required + - The standard header file shall not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 21.5 `_ + - Required + - The standard header file shall not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 21.6 `_ - Required - The Standard Library input/output routines shall not be used - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 21.7 `_ + - Required + - The Standard Library functions atof, atoi, atol and atoll of + shall not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 21.8 `_ + - Required + - The Standard Library functions abort, exit and system of + shall not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 21.9 `_ - Required - The library functions bsearch and qsort of shall not be used @@ -666,6 +723,11 @@ maintainers if you want to suggest a change. - The Standard Library time and date routines shall not be used - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 21.12 `_ + - Advisory + - The exception handling features of should not be used + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 21.13 `_ - Mandatory - Any value passed to a function in shall be representable as an @@ -725,12 +787,25 @@ maintainers if you want to suggest a change. - The Standard Library function system of shall not be used - + * - `Rule 22.1 `_ + - Required + - All resources obtained dynamically by means of Standard Library + functions shall be explicitly released + - + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 22.2 `_ - Mandatory - A block of memory shall only be freed if it was allocated by means of a Standard Library function - + * - `Rule 22.3 `_ + - Required + - The same file shall not be open for read and write access at the + same time on different streams + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + * - `Rule 22.4 `_ - Mandatory - There shall be no attempt to write to a stream which has been opened as @@ -748,6 +823,31 @@ maintainers if you want to suggest a change. stream has been closed - + * - `Rule 22.7 `_ + - Required + - The macro EOF shall only be compared with the unmodified return + value from any Standard Library function capable of returning EOF + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 22.8 `_ + - Required + - The value of errno shall be set to zero prior to a call to an + errno-setting-function + - + + * - `Rule 22.9 `_ + - Required + - The value of errno shall be tested against zero after calling an + errno-setting-function + - + + * - `Rule 22.10 `_ + - Required + - The value of errno shall only be tested when the last function to + be called was an errno-setting-function + - + + Terms & Definitions -------------------