From nobody Fri May 17 03:00:52 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=1698103956; cv=none; d=zohomail.com; s=zohoarc; b=CW7alwX5eNirOi4NJI5EtQ/CnGhfE5JFlGmsPUMwVEUU3G3Z/jYKNAPR1wRacA8Z3cKTF9K+XJwX63qoVHCaPPfR0atj7vdSJVSQKevgScnYIT76JnNpokyjELfHDdtFSDmFtXFYNNijguW/hK3kVSqFJXKfA7joXfVna5xqG2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698103956; 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=uLuzHatneV76nJJFL1PlpyxEQk40xvKDlEVrPnRS2yM=; b=dXrOyrZXCi7QEdJsBxqa+YXBlLc8x9sBTWGq2JiOXyiAvCxyEfrXlZcQ4r+5ROGF6tLFU8p3tOjoGL26ic/3mJE9B+lm5nYx4bNDg+RHjGiBhDgkaFJatGcvD1JtTMF4am422+vNNO68i99lI83uWG2a0wnzL5TXdSEQMJpmZSE= 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 1698103956610278.9886874348192; Mon, 23 Oct 2023 16:32:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.621636.968297 (Exim 4.92) (envelope-from ) id 1qv4Ou-0004LQ-RX; Mon, 23 Oct 2023 23:32:00 +0000 Received: by outflank-mailman (output) from mailman id 621636.968297; Mon, 23 Oct 2023 23:32:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qv4Ou-0004LJ-OP; Mon, 23 Oct 2023 23:32:00 +0000 Received: by outflank-mailman (input) for mailman id 621636; Mon, 23 Oct 2023 23:31:59 +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 1qv4Ot-0004LD-5x for xen-devel@lists.xenproject.org; Mon, 23 Oct 2023 23:31:59 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [2604:1380:4601:e00::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5b747218-71fc-11ee-98d5-6d05b1d4d9a1; Tue, 24 Oct 2023 01:31:57 +0200 (CEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 01D1AB82233; Mon, 23 Oct 2023 23:31:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B579C433C8; Mon, 23 Oct 2023 23:31:55 +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: 5b747218-71fc-11ee-98d5-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698103916; bh=iXNzi5iroBNeb9pIMHBuep9UHo+puTOOWGi6z4zxu/s=; h=Date:From:To:cc:Subject:From; b=Ame/hgz/prttA/d1/QfYGMv0cpgbzyNm+NDKRTNb8NdRegeLm7+/KbdsYsnntwNkk c1++LBhkZOhWpheXl7LHYSO/GqRz4gDI9PCqMJwAC3IoAZsTfQB+TxS9wcw6TdujUl gSKgrPhWmHlfVEwf4mpcvRVWjBM78wkDcPaQz+aJYIQ/yaBqzFe4D2p0VCr3aekwpH JXUnuD4FPWTTGNJm+GojZdbsbfWhlzaQ623cUFMLtTAtnTkWEqqE1lNflguSK6e/BU BdcKhATVtWlhaIql2YFsUU11DCXpozQ4uf2Ke623eHsdJeWDs9cGhtAxIpeF0rUNmT ClrjFMaBtY2zA== Date: Mon, 23 Oct 2023 16:31:53 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: xen-devel@lists.xenproject.org cc: sstabellini@kernel.org, julien@xen.org, bertrand.marquis@arm.com, andrew.cooper3@citrix.com, jbeulich@suse.com, roger.pau@citrix.com, george.dunlap@citrix.com Subject: [PATCH] misra: add R14.4 R21.1 R21.2 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: 1698103957831100005 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add 14.4, with the same note and exception already listed for 10.1. Add 21.1 and 21.2, with a longer comment to explain how strategy with leading underscores and why we think we are safe today. Signed-off-by: Stefano Stabellini diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index b423580b23..56eec8bafd 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -422,6 +422,13 @@ maintainers if you want to suggest a change. =20 while(0) and while(1) and alike are allowed. =20 + * - `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 to boolean are allowed + * - `Rule 16.7 `_ - Required - A switch-expression shall not have essentially Boolean type @@ -479,6 +486,24 @@ maintainers if you want to suggest a change. they are related - =20 + * - `Rule 21.1 `_ + - Required + - #define and #undef shall not be used on a reserved identifier or + reserved macro name + - No identifiers should start with _BUILTIN to avoid clashes with + GCC reserved identifiers. In general, all identifiers starting with + an underscore are reserved, and are best avoided. However, Xen + makes extensive usage of leading underscores in header guards, + bitwise manipulation functions, and a few other places. They are + considered safe as checks have been done against the list of + GCC's reserved identifiers. They don't need to be replaced. + + * - `Rule 21.2 `_ + - Required + - A reserved identifier or reserved macro name shall not be + declared + - See comment for Rule 21.1 + * - `Rule 21.13 `_ - Mandatory - Any value passed to a function in shall be representable = as an