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 86389C35274 for ; Mon, 18 Dec 2023 14:28:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.656042.1023954 (Exim 4.92) (envelope-from ) id 1rFEbN-0005rg-3l; Mon, 18 Dec 2023 14:28:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 656042.1023954; Mon, 18 Dec 2023 14:28:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rFEbN-0005rZ-1F; Mon, 18 Dec 2023 14:28:13 +0000 Received: by outflank-mailman (input) for mailman id 656042; Mon, 18 Dec 2023 14:28:11 +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 1rFEbL-0005rT-Re for xen-devel@lists.xenproject.org; Mon, 18 Dec 2023 14:28:11 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ab6ac118-9db1-11ee-98eb-6d05b1d4d9a1; Mon, 18 Dec 2023 15:28:10 +0100 (CET) Received: from [192.168.1.9] (net-37-182-35-120.cust.vodafonedsl.it [37.182.35.120]) by support.bugseng.com (Postfix) with ESMTPSA id 48E354EE0742; Mon, 18 Dec 2023 15:28:09 +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: ab6ac118-9db1-11ee-98eb-6d05b1d4d9a1 Message-ID: <2c4de29a-ec34-4261-bcd9-ee0db52ee09f@bugseng.com> Date: Mon, 18 Dec 2023 15:28:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/9] xen: address violations of MISRA C:2012 Rule 11.8 To: Jan Beulich , Maria Celeste Cesario Cc: consulting@bugseng.com, Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Wei Liu , xen-devel@lists.xenproject.org, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Shawn Anastasio , Doug Goldstein References: <3b3996fb-ec66-468e-8ee8-eb8e7648f59d@suse.com> Content-Language: en-US From: Simone Ballarin Organization: BUGSENG In-Reply-To: <3b3996fb-ec66-468e-8ee8-eb8e7648f59d@suse.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 14/12/23 13:36, Jan Beulich wrote: > On 14.12.2023 13:07, Simone Ballarin wrote: >> From: Maria Celeste Cesario >> >> The xen sources contain violations of MISRA C:2012 Rule 11.8 whose >> headline states: >> "A conversion shall not remove any const, volatile or _Atomic >> qualification from the type pointed to by a pointer". >> >> This patch amends or removes casts that unnecessarily drop >> const and volatile qualifiers. >> >> Example: >> >> static always_inline bool int_##name(volatile void *p) >> { >> volatile uint32_t *ptr = (uint32_t *)p; /* Non-compliant */ >> volatile uint32_t *ptr = (volatile uint32_t *)p; /* Compliant, proposed change */ >> } > > Why would you further complicate things when here the cast can simply > be dropped? > > Jan Of course, the example will be improved in v2. -- Simone Ballarin, M.Sc. Field Application Engineer, BUGSENG (https://bugseng.com)