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

Re: [XEN PATCH v3 1/2] x86/vmsi: rename variables to address MISRA C:2012 Rule 5.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 8 Aug 2023 15:22:18 +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=LXcdRd7ipB1pLLnNe0yBmXkY6bBajuyKhto5TUY9SDY=; b=RP/2mBoj1qbXJlvqHJNBAYCHstOvVc4EO6CM9sC/MSqMlJwnPMOmddioDoKYIFbb3kf7SaG6LCSKHf7fEKYXXAVjr9Metm2/etVhCWO2acQ49lAeXFuslZj2aaqWYfLWN2X3+Ae9VddJxxiz16wGZgHJf+dMxmd2Z9Vp2KiA2ZNM5GxcOvLo5jDyXmFPEhFIC4vnaZK4qzl4XTTVmbKhI9iyTZxn+4VFQVs9SAtvx5seAnfYzYjKuOEicpXuHK7Y6VQVgY2QXb2ejb57XwOEzqsgZxDrzCJU5p7iEgNpJjvJBqIPAxaMUWt1e8pqeFTv+swAEzPjddN4LP8XZbSE8A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XyAPWua5zCdja2FoLnbNhQRPl3z1vuQj1DMYL52NCjwHJAVAiggMaT62rcctPVBNFjLSgI88yCHqoQRb7LIt+mi3AIPGUZCi1V8tAxaFP4P7wOGuRMQqZ6po2n0y0XxXKfOtuqtzU7Jr5Qg22ORKy/hV9s8EKtgjKa/wDbs76cfqon2n9hibuFcwvN3SdhhU1RQmNvv7rm0dAy7oLJWWYbfDQhoyLSD8Q5z/k3rDcl0MZhScUTNJMZxT/WlONIB90H6xHm021O+8A9h+CqideoZT9YfyqB0IoFFB2S2iYWaSaH8TpGKkE3XLgyBdlmWznHv74+1p9MNCfJIP0/kEqg==
  • 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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 08 Aug 2023 13:22:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 08.08.2023 14:22, Nicola Vetrini wrote:
> The local variables 'irq_desc' shadow the homonymous global variable,
> declared in 'xen/arch/x86/include/asm/irq.h', therefore they are renamed
> 'irqd' for consistency with ARM code. Other variables of the same type
> in the file are also renamed 'irqd' for consistency.

I'm pretty sure I pointed out that Arm uses a mix of "desc" and "irqd".
So "consistency with ARM code" doesn't ...

> --- a/xen/arch/x86/hvm/vmsi.c
> +++ b/xen/arch/x86/hvm/vmsi.c
> @@ -281,7 +281,7 @@ static int msixtbl_write(struct vcpu *v, unsigned long 
> address,
>      unsigned int nr_entry, index;
>      int r = X86EMUL_UNHANDLEABLE;
>      unsigned long flags;
> -    struct irq_desc *desc;
> +    struct irq_desc *irqd;

... require e.g. this rename. As mentioned before: Let's limit code
churn where possible, and where going beyond what's strictly necessary
isn't otherwise useful; there's already enough of it with all these not
really helpful Misra changes.

> @@ -462,7 +462,7 @@ static void del_msixtbl_entry(struct msixtbl_entry *entry)
>  
>  int msixtbl_pt_register(struct domain *d, struct pirq *pirq, uint64_t gtable)
>  {
> -    struct irq_desc *irq_desc;
> +    struct irq_desc *irqd;

This one indeed wants renaming, but then - consistent within the file -
to "desc". At least that's my view.

Jan



 


Rackspace

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