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

Re: [XEN PATCH v2 3/4] x86/irq: rename variable to address MISRA C:2012 Rule 5.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 7 Aug 2023 14:55:23 +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=714EprljTvlE97Mb6c7roih6QuC6/NDH9mWbJEMKvWM=; b=QKsOQEvv0e9G7s/07JsFAKGbrBf366nR9dFFxzCNYAKHK+Dio2hhjJgVTqnYKMkgPP3LMp4JLw0ljjJcsWoBwDe1nuENEhAygLb0tRyRFJxBhcfA8IFIa1qPZMYl2D4Dvsm0u/8h0Hobx2O1EaAmKiXt12jT+vJ9ca8iLFbMRZOxVfNFYl1/G70hyMWDn6lI3/4oft6A9WF6eD8PRHNNZ48HyRMswz4vqinot8382NqTmdS5uJ1YtFF4MXwgQVRYB+4AXc9ROklj0rKylXlwWk8CcHhrBErqmLZgJxCZIepixnygZ3GT2WAqv2gUoMtb+IUS592lhirTfRx8Zc3wmw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dp/mVhC4pjUiEL2c/qt60WwX5Yi0+BxHThRDxiGs9v+5MjwGH5R/OrUUiCSID23vaCogNWOMavGsCSqCgRPOWPM1xYzdKfwSGAoh6KEaUsywpFHm9K/tBwg5KjX8IM+O47tFMWuqfB4b9/AV1PKWWxtTgSldIHzxcxJqLW8vMxBdWhVs+LYocWKmNl/SZvEffr+rpZyTdOS9ns2UIm6zHD/U+IbRZ1nJXXb7jGMPrIJUXuLiZpPKH9ObgJU1X60h9cR3mXPvLLnFpAOkbZBrPgHuE7foogMSid1PfyiS4PDouPIq6Vgvv5JPY8JfO3MxdwHLBSKpg3ZDZcUYgXXNBA==
  • 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, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 07 Aug 2023 12:55:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.08.2023 10:03, Nicola Vetrini wrote:
> The extern variable 'irq_desc' defined in 'irq.h' is shadowed by
> local variables in the changed file. To avoid this, the variable is
> renamed to 'irq_description'.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> ---
>  xen/arch/x86/hvm/hvm.c         |  2 +-
>  xen/arch/x86/include/asm/irq.h |  2 +-
>  xen/arch/x86/io_apic.c         | 10 +++++-----
>  xen/arch/x86/irq.c             | 12 ++++++------
>  xen/arch/x86/msi.c             |  4 ++--
>  xen/include/xen/irq.h          |  2 +-
>  6 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 2180abeb33..ca5bb96388 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -474,7 +474,7 @@ void hvm_migrate_pirq(struct hvm_pirq_dpci *pirq_dpci, 
> const struct vcpu *v)
>  
>          if ( !desc )
>              return;
> -        ASSERT(MSI_IRQ(desc - irq_desc));
> +        ASSERT(MSI_IRQ(desc - irq_descriptor));
>          irq_set_affinity(desc, cpumask_of(v->processor));
>          spin_unlock_irq(&desc->lock);
>      }
> diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
> index ad907fc97f..f6df977170 100644
> --- a/xen/arch/x86/include/asm/irq.h
> +++ b/xen/arch/x86/include/asm/irq.h
> @@ -172,7 +172,7 @@ int assign_irq_vector(int irq, const cpumask_t *mask);
>  
>  void cf_check irq_complete_move(struct irq_desc *desc);
>  
> -extern struct irq_desc *irq_desc;
> +extern struct irq_desc *irq_descriptor;

In Arm code you'll find

static irq_desc_t irq_desc[NR_IRQS];

It's static there right now, yes, but we don't want to introduce arch
differences here. Therefore the global wants leaving alone, and "desc"
wants using where function parameters collide. (Arm uses either "desc"
or "irqd" everywhere afaics.)

Jan



 


Rackspace

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