From patchwork Sat Jun 22 00:14:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 13708145 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 D2D85C27C78 for ; Sat, 22 Jun 2024 00:14:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.745698.1152852 (Exim 4.92) (envelope-from ) id 1sKoOp-0001W6-M0; Sat, 22 Jun 2024 00:14:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 745698.1152852; Sat, 22 Jun 2024 00:14:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sKoOp-0001Vz-JH; Sat, 22 Jun 2024 00:14:35 +0000 Received: by outflank-mailman (input) for mailman id 745698; Sat, 22 Jun 2024 00:14:34 +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 1sKoOo-0001Vr-JZ for xen-devel@lists.xenproject.org; Sat, 22 Jun 2024 00:14:34 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20600.outbound.protection.outlook.com [2a01:111:f403:2415::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 65b243f1-302c-11ef-b4bb-af5377834399; Sat, 22 Jun 2024 02:14:31 +0200 (CEST) Received: from PH8PR15CA0024.namprd15.prod.outlook.com (2603:10b6:510:2d2::9) by IA0PR12MB7603.namprd12.prod.outlook.com (2603:10b6:208:439::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.22; Sat, 22 Jun 2024 00:14:27 +0000 Received: from CY4PEPF0000EE3D.namprd03.prod.outlook.com (2603:10b6:510:2d2:cafe::7c) by PH8PR15CA0024.outlook.office365.com (2603:10b6:510:2d2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.36 via Frontend Transport; Sat, 22 Jun 2024 00:14:25 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000EE3D.mail.protection.outlook.com (10.167.242.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Sat, 22 Jun 2024 00:14:25 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 21 Jun 2024 19:14:24 -0500 Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Fri, 21 Jun 2024 19:14:23 -0500 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: 65b243f1-302c-11ef-b4bb-af5377834399 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HT6a+CuTBJXei+tT/ct46Rhgd7mUgIJ4dg78/Iua/RDmMus/0o1YXwhCAy7LdtCT1TLMWg57qak9SmIB8dpIUpLeWzFTtzNd299NVCeYcJhedJ/4Te+lVFobgfd4c5tA9trHLt3lZNNHQO0iHqs2MijEcT/6ZsP1o8eIl2MqimE54XJFKTD2RJGMMWGKguE9qaYF1y5+KZAf50RZGrRFOMQK+lyQwsEYEY48xOikBpR3tPrzb+3B31j64ACfEjpjhQXcLKvsFkcXIwekpwsWgIW9jZtTsQyr1sZVmXBbPywBgWhAJLS3Ka/op2ZowTErUf7ybSHIfRFOSw7kgMfQAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Kj4Slr3V2fdHolN+j+c/+W5Lbdyo17aak37rymkcfgA=; b=MUkYAP+O1NHWJxrVNwg/ddK8y3H1C1CWYfkg80178YvAPOv29H4Tx/ko6mhQHeZomiqaXpcdEHVN06Ve8mXY6pd/rbrPZqsfO8gSoYGBbksYiPov3V2/Cn/M80Hka5K+6fwrUz96psAXrFdiyg7FnoGEVyJGDFkFNuCQVgUHCQpe3n2waRDIfyyBuXHf1NKuT6Pflc2qbAZU/bVTK/7ypsRf2mn5WrB4hMOoklquJ61dgGEbOgrb0ntKzR2h/UybD/kk6f24AnrgdeXFLcMcVo37kl/L1Z2Lum4Zf8FY5/Jcf1rFJek9xyFrwRTalztRkM9y5RAS9qYQCik6GYmVsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kj4Slr3V2fdHolN+j+c/+W5Lbdyo17aak37rymkcfgA=; b=2uUP5fZ/9K+3sjfx123GEnFb0xWj+CcjV1TokkDoqzhl3wU7q0pmAHmcIg1MWsOU8Ww36r7xQ0VtF5ZFSaV8ymPyiXiG6hn/fty8E8bmd5LOtqmUKBF2pw+wTKV6HhIuB8ZkSdZIW9bucJPkrl8Ms/StrHzmjH9JCtLsvhFkF6g= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Stefano Stabellini To: CC: , , , , , , , Stefano Stabellini Subject: [PATCH v2] docs/misra: rules for mass adoption Date: Fri, 21 Jun 2024 17:14:22 -0700 Message-ID: <20240622001422.3852207-1-stefano.stabellini@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3D:EE_|IA0PR12MB7603:EE_ X-MS-Office365-Filtering-Correlation-Id: 2d8de61b-770d-4d36-dc56-08dc92504635 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|36860700010|82310400023|1800799021; X-Microsoft-Antispam-Message-Info: y8YPdVfcTEwjHHvnryncb46idKUksHCtKNya/7pJCcy5CFryPdZf3bOcEgyVliqtVwG2MIdkY89iOBq2Y1QRgk5FK2lrQMyasG+Ov6GlRyNf2fBqXPYqn6bbYSRc4sMneU9p471Qd2TXkeXHk4wwzpeUFWzOu7pPR40PT7yvtE95dy08DXKouwoBxSPR8jtXbt/PiQueCzHln4/UL88LoJ3j/NlZbihoj/xMiXOHqBYujwR/fZ1KS6Yk8/eNTl7UEMiaUw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qcVQS9cIte4YlyBAzxWNOLx9MoNTooOfPPZgTFUD8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230037)(376011)(36860700010)(82310400023)(1800799021);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2024 00:14:25.1491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d8de61b-770d-4d36-dc56-08dc92504635 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EE3D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7603 From: Stefano Stabellini 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 --- Changes in v2: - replicate the Xen doesn't provide a stdlib message for 22.8, 22.9, 22.10 - remove stray empty bullet for 22.1 --- docs/misra/rules.rst | 99 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 80e5e972ad..6158bad31c 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,24 @@ 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 +822,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 + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 22.9 `_ + - Required + - The value of errno shall be tested against zero after calling an + errno-setting-function + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + * - `Rule 22.10 `_ + - Required + - The value of errno shall only be tested when the last function to + be called was an errno-setting-function + - Xen doesn't provide, use, or link against a Standard Library [#xen-stdlib]_ + + Terms & Definitions -------------------