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 907CAEB64DD for ; Wed, 9 Aug 2023 13:08:38 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.581080.909607 (Exim 4.92) (envelope-from ) id 1qTiv6-0007sp-Nl; Wed, 09 Aug 2023 13:08:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 581080.909607; Wed, 09 Aug 2023 13:08:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTiv6-0007si-Kp; Wed, 09 Aug 2023 13:08:12 +0000 Received: by outflank-mailman (input) for mailman id 581080; Wed, 09 Aug 2023 13:08:10 +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 1qTiv4-0007sc-Nh for xen-devel@lists.xenproject.org; Wed, 09 Aug 2023 13:08:10 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c790fb95-36b5-11ee-8613-37d641c3527e; Wed, 09 Aug 2023 15:08:06 +0200 (CEST) Received: from support.bugseng.com (support.bugseng.com [162.55.131.47]) by support.bugseng.com (Postfix) with ESMTPA id A31644EE073F; Wed, 9 Aug 2023 15:08:05 +0200 (CEST) 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: c790fb95-36b5-11ee-8613-37d641c3527e MIME-Version: 1.0 Date: Wed, 09 Aug 2023 15:08:05 +0200 From: Nicola Vetrini To: Jan Beulich Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Wei Liu , xen-devel@lists.xenproject.org Subject: Re: [XEN PATCH 4/8] xen/arm: address MISRA C:2012 Rule 8.4 In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.3 Message-ID: <744a4ae451f3751d5a6c97e5f28cdaf1@bugseng.com> X-Sender: nicola.vetrini@bugseng.com Organization: BUGSENG s.r.l. Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit On 09/08/2023 14:42, Jan Beulich wrote: > On 09.08.2023 13:02, Nicola Vetrini wrote: >> 'xen/hypercall.h' is included in 'xen/arch/arm/setup.c' to allow >> the declaration of 'arch_get_xen_caps' to be visible when >> defining the function. >> >> The header 'xen/delay.h' is included in 'xen/arch/arm/time.c' >> to allow the declaration of 'udelay' to be visible. >> >> At the same time, a declaration for 'get_sec' is added in >> 'xen/include/xen/time.h' to be available for every call site >> (in particular cper.h). >> >> Signed-off-by: Nicola Vetrini >> --- >> xen/arch/arm/setup.c | 1 + >> xen/arch/arm/time.c | 1 + >> xen/include/xen/cper.h | 3 +-- >> xen/include/xen/time.h | 1 + >> 4 files changed, 4 insertions(+), 2 deletions(-) > > I would have almost put this off as Arm-only, but then saw this > diffstat. > How come you consider cper.h Arm-related? This is used only by APEI > source > files, which in turn are used only by x86 afaics. So I think you want > to > split off the movement of the get_sec() declaration. > My mistake, I squashed the arm and the cper part together to avoid touching the time headers twice, but the old tag remained. > As to title and description (perhaps affecting more than just this > patch): > Failing to have declarations in scope where definitions appear is an at > least latent bug. We fix these as we find them anyway, so Misra is > secondary here. Hence I'd like to suggest that you declare any such > change as an actual bugfix, ideally including a Fixes: tag. It is of > course fine to mention that this then also addresses Misra rule 8.4. > > Jan Ok -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)