[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH 4/8] xen/arm: address MISRA C:2012 Rule 8.4


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 9 Aug 2023 14:42:55 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=qDCvP9gDz4OwFGJD9WlNakVlIXibVVDA0fVaxyA6IxA=; b=gO4vFJqruKJjqr2ChuEHntO1f93043HMBGDADAZ2tC553AWhJxAT0M+QQvFSjENgCUNuewZWSV9jsSGPMmAJMVf7taXRDVdqTwupGmtGdl2Kz8/UALFzYAphV9sWHQDUmoXOFCrtBBXFHReLMpPEW94nPIh0UVNEvBk0V3m+zvrHxt+TZh+WWElYJsldmtno3uJOA+HVtXU4Vs4enX03cUQvlETelZ9FG/M3+6uJknK2BLzTANqgYPo2+Myncq1x8nsKcKBAqTKjTdRzCi9YndpTImSEGWWdpwFxHVFRXp4mBwSaukor+AcNx5vAiPHb0TXCV4CpNI2TPjtQPNm+jw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMZKrwULhP1vU7HwgyLMZOEqxyHHk5PsSMSmnbOno3ZUmvomHCRMwksCIM4x7iWYCJZ+DEtAS607yxONVj4RheE9o87vzOMACPvhU6L4SXzCXnCQyh3sPvZ60H1s7BrY3Mx/gkNyJiDbnGYj5iHwec63ulA/ZBlzUW5VgXWYYEjFtWA6RCtOxf2pzyWqFaNYjFzYyyS1P12hKT2e50OYCyZkPPIpke2MjBsKAc2scygIVC70DqKIZRwoPlqdMh5fvloX5KdeftErCk8oAOi/7nTWzyWm0dRJF7ppmM4YESw+hdCiC3+BXhQY6wvoBSXq0WgSyads8XMiqe31spFxLQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 09 Aug 2023 12:43:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <nicola.vetrini@xxxxxxxxxxx>
> ---
>  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.

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.