From mboxrd@z Thu Jan 1 00:00:00 1970 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 9A204C54E67 for ; Fri, 15 Mar 2024 11:20:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.693809.1082401 (Exim 4.92) (envelope-from ) id 1rl5bc-0007UI-Pz; Fri, 15 Mar 2024 11:20:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 693809.1082401; Fri, 15 Mar 2024 11:20:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rl5bc-0007UB-MG; Fri, 15 Mar 2024 11:20:08 +0000 Received: by outflank-mailman (input) for mailman id 693809; Fri, 15 Mar 2024 11:20:06 +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 1rl5ba-0007Nv-Sg for xen-devel@lists.xenproject.org; Fri, 15 Mar 2024 11:20:06 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f996eb03-e2bd-11ee-afdd-a90da7624cb6; Fri, 15 Mar 2024 12:20:06 +0100 (CET) Received: from support.bugseng.com (support.bugseng.com [162.55.131.47]) by support.bugseng.com (Postfix) with ESMTPA id CAD784EE073C; Fri, 15 Mar 2024 12:20:05 +0100 (CET) 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: f996eb03-e2bd-11ee-afdd-a90da7624cb6 MIME-Version: 1.0 Date: Fri, 15 Mar 2024 12:20:05 +0100 From: Nicola Vetrini To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Cc: Simone Ballarin , xen-devel@lists.xenproject.org, consulting@bugseng.com, Maria Celeste Cesario , Jan Beulich , Andrew Cooper , Wei Liu , Kevin Tian Subject: Re: [PATCH v2 1/2] x86/IOMMU: address violations of MISRA C:2012 Rule 14.4 In-Reply-To: References: <746a33fff1386b2e76657b5f7cfb31f3b117a1fe.1702310368.git.maria.celeste.cesario@bugseng.com> Message-ID: X-Sender: nicola.vetrini@bugseng.com Organization: BUGSENG s.r.l. Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-03-12 12:01, Roger Pau Monné wrote: > On Wed, Dec 13, 2023 at 05:10:50PM +0100, Simone Ballarin wrote: >> From: Maria Celeste Cesario >> >> The xen sources contain violations of MISRA C:2012 Rule 14.4 whose >> headline states: >> "The controlling expression of an if statement and the controlling >> expression of an iteration-statement shall have essentially Boolean >> type". >> >> Add comparisons to avoid using enum constants as controlling >> expressions >> to comply with Rule 14.4. > > If we really want to go this route, we also need to amend the comment > in iommu_intremap definition, as it's no longer valid: > > extern enum __packed iommu_intremap { > /* > * In order to allow traditional boolean uses of the iommu_intremap > * variable, the "off" value has to come first (yielding a value of > zero). > */ > iommu_intremap_off, > > We no longer allow traditional boolean uses of iommu_intremap. > > Thanks, Roger. Noted, thanks. -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)