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

Re: [PATCH v4 4/7] iommu/arm: Introduce iommu_add_dt_pci_sideband_ids API


  • To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 7 Jun 2023 09:59:47 +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=zf8NJiitQcqSXr0G/SCMmKgkqguEKzJtyTQSegb1qsc=; b=QEfJ6tfaXnnDMVpo3BDerdBPuYAYHGnD33c5hNVjs/mcQsnZTzecPR0AvCZZojBPVruRN/oOJWqRTz9dFoKvjYQD/YDlY7C/k3FPepcKUYjU1feUY3JpwP7iFndk/BQEdb0F1yk/0MB7kyoVH6+E/SUlEkXmYahuq7yzQqK7hoYCdtio/wNVjvAfziU/j3ANrfCpxIkRK5AN+c0C7JjURHwW6Z7pxj+qdwSm2ikqwWMt0xbUli6pvnWE0VrKvhasmpZc9dqSMofEtGmmDYL6hFQQE1eIEMCvV9rEyC7rEzpXH8H2QsLoIzs9Prm4d0qGKfXlu0AB8OcGrd37ceKCCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TPnyfHi2Dxv/5nEk/ywkeoMhsL+Y7o4g3R0RWOw3oF+zVN5V2Q+9N+m3tEACU4wg4ICnRNCdTweoqdzOBhxyTqH26xGVgk4WVLo8ra3e/Ovi8NY08cBEGIwWOyWbWKBYbtpK6hygLY7/eDSRqiibc7M4W8dYVEViXKj5ZyedSOXcQlrkvGIlV66NUSSzRf8BZqSbAU5ebAJ/DWCvdOGJMa7Etk0defKJjxgrUC986BDd/dYC0Bkj3VkQfUXxli9d4Av7DYw9xW+TNKAMVhgwE8/8S6XzYhi8l3dP4TczTAUZyTjTy+5Ubjrfs47+KGAdDgIiOIlyMnlcLvYbmSxoug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Rahul Singh <rahul.singh@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Jun 2023 08:00:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.06.2023 05:02, Stewart Hildebrand wrote:
> --- a/xen/include/xen/iommu.h
> +++ b/xen/include/xen/iommu.h
> @@ -26,6 +26,9 @@
>  #include <xen/spinlock.h>
>  #include <public/domctl.h>
>  #include <public/hvm/ioreq.h>
> +#ifdef CONFIG_ACPI
> +#include <asm/acpi.h>
> +#endif

This header is supposed to be usable without #ifdef, and then ...

> @@ -228,12 +232,28 @@ int iommu_release_dt_devices(struct domain *d);
>   *      (IOMMU is not enabled/present or device is not connected to it).
>   */
>  int iommu_add_dt_device(struct dt_device_node *np);
> +int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev);
>  
>  int iommu_do_dt_domctl(struct xen_domctl *, struct domain *,
>                         XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
>  
> +#else /* !HAS_DEVICE_TREE */
> +static inline int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev)
> +{
> +    return 0;
> +}
>  #endif /* HAS_DEVICE_TREE */
>  
> +static inline int iommu_add_pci_sideband_ids(struct pci_dev *pdev)
> +{
> +    int ret = 0;
> +#ifdef CONFIG_ACPI
> +    if ( acpi_disabled )
> +#endif

... you don't need #ifdef here either.

> +        ret = iommu_add_dt_pci_sideband_ids(pdev);
> +    return ret;
> +}

Also (nit) please follow (partly unwritten, I admit) style guidelines:
A blank line between declaration(s) and statement(s), and another one
ahead of a function's main "return".

Jan



 


Rackspace

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