From patchwork Wed Jun 26 01:39: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: 13712176 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 DC81DC3064D for ; Wed, 26 Jun 2024 01:39:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.748238.1155838 (Exim 4.92) (envelope-from ) id 1sMHdG-0002z4-Fq; Wed, 26 Jun 2024 01:39:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 748238.1155838; Wed, 26 Jun 2024 01:39:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sMHdG-0002yx-D7; Wed, 26 Jun 2024 01:39:34 +0000 Received: by outflank-mailman (input) for mailman id 748238; Wed, 26 Jun 2024 01:39:33 +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 1sMHdF-0002yr-Bp for xen-devel@lists.xenproject.org; Wed, 26 Jun 2024 01:39:33 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20611.outbound.protection.outlook.com [2a01:111:f403:2009::611]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ee765cd4-335c-11ef-90a3-e314d9c70b13; Wed, 26 Jun 2024 03:39:31 +0200 (CEST) Received: from MW4PR03CA0284.namprd03.prod.outlook.com (2603:10b6:303:b5::19) by DM6PR12MB4330.namprd12.prod.outlook.com (2603:10b6:5:21d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Wed, 26 Jun 2024 01:39:26 +0000 Received: from SJ5PEPF000001CC.namprd05.prod.outlook.com (2603:10b6:303:b5:cafe::f9) by MW4PR03CA0284.outlook.office365.com (2603:10b6:303:b5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.38 via Frontend Transport; Wed, 26 Jun 2024 01:39:26 +0000 Received: from SATLEXMB03.amd.com (165.204.84.17) by SJ5PEPF000001CC.mail.protection.outlook.com (10.167.242.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.15 via Frontend Transport; Wed, 26 Jun 2024 01:39:25 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 25 Jun 2024 20:39:24 -0500 Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 25 Jun 2024 20:39:24 -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: ee765cd4-335c-11ef-90a3-e314d9c70b13 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HaSDu3jVgMgNO/gwe9ho8we22o0ZUMhlm5pFS6zBd7hgf6R88M8FWrINUUTl2uye1hfpzIUhFct6g8ZHbqgKQ30Fz5pK+qu5eFynJeeZ4CAeMTyJy9E8snkcWEB7GYxDdy861vqXiDWn5kmDX+hWt1/KtB+Y/10X11dq4mN9misfUcreD6gSUgXZiFJAyYuROCu1X4tuOi76qHyB1q9WbOl66Ju2KnsWJjzUmkWXfGBW3V9cnifITeUJq3X9xkOrw7p8ku7g7fNv0Tm83620D3U8PCFfhdA0PjxonRY0tlAi1oxrAIwUdI3jB3O1/i0SIEnD/cnXRXczxX7Qwuedng== 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=1uaA7rDWzroIcGQmI5b8PlLH7NpF7Sn3wlDKriPxvc0=; b=Qb8ekbc9uqSlIY9UQpu2IkAtXVJ08irob8OSdWxAj8FgJV7766xgZ1pF0o83C6i409FwYDb3SJmLZqlWl6+8/xPNZc+VeAwpHk/+kuDVTRGnlJi6/wogs93LjKOWVU/YQK7N4kNdANTxi1TwFxg1MAzeSjk2So3F+dIr0ae3s9zX2URrSbn1xgXTgBW4agxmS3rZUVGtCMb+f5AYqq44jZHyyLRcfCRAQCnMGbPyeOBp3FjF3AntONZLVye2s2H0V3u6jj7M1obcKfuCIAGxWlj11uYkBzDcWG9HwMaAYCFUVkeFklUnDyT3svFHrO5xutsjtq9wl5+q9XvqYepz2A== 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=1uaA7rDWzroIcGQmI5b8PlLH7NpF7Sn3wlDKriPxvc0=; b=K/c84thm4moAQ+QFroNMjrcIb5whbSVPCTwuDUrQEdfaYz4Jry0JWQKu0kirWfLog1Po749UeuIlo/DOcqdsmvEdTWuAp752DQUBmIx2anws7fKdoGQ7fkzhMVdAaNa1rwOQ8SJ6SkzB6miB44yY1HZaK5tD68LWH3tyTmA41GY= 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=SATLEXMB03.amd.com; pr=C From: Stefano Stabellini To: CC: , , , , , , , Stefano Stabellini Subject: [PATCH v3] docs/misra: rules for mass adoption Date: Tue, 25 Jun 2024 18:39:22 -0700 Message-ID: <20240626013922.92089-1-stefano.stabellini@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: stefano.stabellini@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CC:EE_|DM6PR12MB4330:EE_ X-MS-Office365-Filtering-Correlation-Id: 822fe646-3b7e-4ff8-0b0e-08dc9580d010 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230038|1800799022|82310400024|36860700011|376012; X-Microsoft-Antispam-Message-Info: WKYr6GK1VtTcIuBbjeXAZBWJIKLe4TnR26xnep2fffKQUoOSLbS8TjLYb3D1//nSp1nZ3RXbAvY5PL4ywahloDbGBKinYUm92fAWxfdT+wMhBzfk+T2N9G7gpEZ5Pdo/IO1HJDRkH3mExjg7R6r3PVkyrB6yXPkA4mp4qhiNPPEKSBaqyhW7gIY9pWJgoCNxCEtZ7chwDxPDQqwE8djitektyI/O9u8OM4MsqRcEWXapwt+1HhvYo0jhZzDFvJmPRUbsrSWEdBmAPk9vj+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HQeVfYQYWzO8g9KPow2mf/FAU04I= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230038)(1800799022)(82310400024)(36860700011)(376012);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 01:39:25.7426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 822fe646-3b7e-4ff8-0b0e-08dc9580d010 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4330 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 Acked-by: Andrew Cooper --- Changes in v3: - add 21.11 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 | 104 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 80e5e972ad..2e11566e20 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,16 @@ 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.11 `_ + - Required + - The standard header file 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 +792,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 +827,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 -------------------