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

Re: [XEN PATCH v2] x86/iommu_init: address a violation of MISRA C:2012 Rule 8.3


  • To: Federico Serafini <federico.serafini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 30 Oct 2023 16:01:14 +0100
  • 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=icjcyNuIn5b0D9mqM/w/ep/8gav10tNy7bxwpu/29wM=; b=J20ibSDQQQ0UzHj8c8JZa60OsrMg+CVSZ2rMnhsSEeFuvjXEq3ZrUXiR3otKVokaAevZj32rnUpQnXIJj+YQhecwwKUdLWebntWkSuNVb0NpbTvY+ZglGibcL/oXcU/0aEU7Jqx7vQY2nSbbN4ARvFKV6sV/fWumgYen1sX26fq+5uCNrdccInU2LJI7rKt6g+9kcJBBJeZfzsKhuLBR292r4We1iUd+5k0eIf9RUEPzwCYsqvEG/nQi1vKGW/JSziK37+YBLEcejOhwJX7RALf8bNgZxGA3VH9HGMoz2KCxJ6letm4fsxu4AxO9uYeSbj8+RzY8CweXkLT4e9mk0Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaJk2m4TnDuiONzoQ/KKpyv2wCCKGnsTi9XjwnKUa/+6kQhodKrGQurA6ZNw+hnrJGHhKqdplX0UeUvkFOlIHTM0WEY7l3+gFtudxXios2lSCXIxVJo7cBwT7qJzW/+SzM66Qtmuket0O6stXvGsLSSCykmVvH8PTqgNvCbdGhKRGjoCfCB70QfYeM54NzLM3FFEf6jcP/0EvIaC1KdWqPna87l1nZKPQty8+6D2bs1DIn34nLiNys4iPPx0l2MZnz9eWxUXCkpBvOCMD03GIMP4dLIzVQKWMAJZbg2zEmC3dKiPp5tTJNAlCUjS3uqQLtg7acVGgAZNJYD2ZPJhrg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 30 Oct 2023 15:01:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 25.10.2023 15:01, Federico Serafini wrote:
> Make function definition and declaration consistent and emphasize that
> the formal parameter is deliberately not used.

Coming back to my earlier objection: Did you consider alternatives? Best
would of course be to get rid of the forward declaration. That seems
possible, albeit not quite as straightforward as it ended up being in
other cases. Second best would be to rename the parameter in the forward
declaration. Question of course in how far "emphasize that the formal
parameter is deliberately not used" is important here. (If it was, I
wonder why VT-d's do_iommu_page_fault() is left alone.)

Jan

> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -692,7 +692,7 @@ static void iommu_check_ppr_log(struct amd_iommu *iommu)
>      spin_unlock_irqrestore(&iommu->lock, flags);
>  }
>  
> -static void cf_check do_amd_iommu_irq(void *unused)
> +static void cf_check do_amd_iommu_irq(void *data)
>  {
>      struct amd_iommu *iommu;
>  
> @@ -702,6 +702,9 @@ static void cf_check do_amd_iommu_irq(void *unused)
>          return;
>      }
>  
> +    /* Formal parameter is deliberately unused. */
> +    (void)data;
> +
>      /*
>       * No matter from where the interrupt came from, check all the
>       * IOMMUs present in the system. This allows for having just one




 


Rackspace

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