mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Juergen Gross" <jgross@suse.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH v3] xen: Remove dependency between pciback and privcmd
Date: Fri, 11 Oct 2024 10:54:39 +0200	[thread overview]
Message-ID: <318bd8a4-a349-4e7b-8653-6995d5f9f125@suse.com> (raw)
In-Reply-To: <20241011034227.1278144-1-Jiqian.Chen@amd.com>

On 11.10.2024 05:42, Jiqian Chen wrote:
> @@ -1757,11 +1756,19 @@ static int __init xen_pcibk_init(void)
>  		bus_register_notifier(&pci_bus_type, &pci_stub_nb);
>  #endif
>  
> +#ifdef CONFIG_XEN_ACPI
> +	xen_acpi_register_get_gsi_func(pcistub_get_gsi_from_sbdf);
> +#endif
> +
>  	return err;
>  }
>  
>  static void __exit xen_pcibk_cleanup(void)
>  {
> +#ifdef CONFIG_XEN_ACPI
> +	xen_acpi_register_get_gsi_func(NULL);
> +#endif

Just wondering - instead of these two #ifdef-s, ...

> --- a/include/xen/acpi.h
> +++ b/include/xen/acpi.h
> @@ -91,13 +91,9 @@ static inline int xen_acpi_get_gsi_info(struct pci_dev *dev,
>  }
>  #endif
>  
> -#ifdef CONFIG_XEN_PCI_STUB
> -int pcistub_get_gsi_from_sbdf(unsigned int sbdf);
> -#else
> -static inline int pcistub_get_gsi_from_sbdf(unsigned int sbdf)
> -{
> -	return -1;
> -}
> -#endif
> +typedef int (*get_gsi_from_sbdf_t)(u32 sbdf);
> +
> +void xen_acpi_register_get_gsi_func(get_gsi_from_sbdf_t func);
> +int xen_acpi_get_gsi_from_sbdf(u32 sbdf);

... wouldn't a static inline stub (for the !XEN_ACPI case) aid overall readability?

Jan

  reply	other threads:[~2024-10-11  8:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-11  3:42 Jiqian Chen
2024-10-11  8:54 ` Jan Beulich [this message]
2024-10-11  9:20   ` Chen, Jiqian
2024-10-11  9:33     ` Chen, Jiqian
2024-10-11 10:10       ` Jan Beulich
2024-10-11 11:12         ` Juergen Gross
2024-10-11 11:16 ` Juergen Gross
2024-10-11 12:06 ` Juergen Gross
2024-10-12  2:22   ` Chen, Jiqian
2024-10-12  2:36     ` Chen, Jiqian
2024-10-12  5:48       ` Jürgen Groß
2024-10-12  6:50         ` Chen, Jiqian
2024-10-12  8:28           ` Jürgen Groß

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=318bd8a4-a349-4e7b-8653-6995d5f9f125@suse.com \
    --to=jbeulich@suse.com \
    --cc=Jiqian.Chen@amd.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®