From: Rahul Singh <Rahul.Singh@arm.com>
To: Oleksandr Andrushchenko <andr2000@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
"oleksandr_tyshchenko@epam.com" <oleksandr_tyshchenko@epam.com>,
"volodymyr_babchuk@epam.com" <volodymyr_babchuk@epam.com>,
"Artem_Mygaiev@epam.com" <Artem_Mygaiev@epam.com>,
"roger.pau@citrix.com" <roger.pau@citrix.com>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
"george.dunlap@citrix.com" <george.dunlap@citrix.com>,
"paul@xen.org" <paul@xen.org>,
Bertrand Marquis <Bertrand.Marquis@arm.com>,
Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Subject: Re: [PATCH v6 7/7] xen/arm: do not use void pointer in pci_host_common_probe
Date: Wed, 17 Nov 2021 11:12:29 +0000 [thread overview]
Message-ID: <96F5FCA2-D8EE-4DC3-8945-619887069C5E@arm.com> (raw)
In-Reply-To: <20211105063326.939843-8-andr2000@gmail.com>
Hi Oleksandr,
> On 5 Nov 2021, at 6:33 am, Oleksandr Andrushchenko <andr2000@gmail.com> wrote:
>
> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>
> There is no reason to use void pointer while passing ECAM ops to the
> pci_host_common_probe function as it is anyway casted to struct pci_ecam_ops
> inside. For that reason remove the void pointer and pass struct pci_ecam_ops
> pointer as is.
>
> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Reviewed-by: Rahul Singh <rahul.singh@arm.com>
Tested-by: Rahul Singh <rahul.singh@arm.com>
Regards,
Rahul
>
> ---
> New in v4
> ---
> xen/arch/arm/pci/ecam.c | 4 ++--
> xen/arch/arm/pci/pci-host-common.c | 6 ++----
> xen/include/asm-arm/pci.h | 5 +++--
> 3 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/xen/arch/arm/pci/ecam.c b/xen/arch/arm/pci/ecam.c
> index 4f71b11c3057..6aeea12a68bf 100644
> --- a/xen/arch/arm/pci/ecam.c
> +++ b/xen/arch/arm/pci/ecam.c
> @@ -24,8 +24,8 @@ void __iomem *pci_ecam_map_bus(struct pci_host_bridge *bridge,
> pci_sbdf_t sbdf, uint32_t where)
> {
> const struct pci_config_window *cfg = bridge->cfg;
> - struct pci_ecam_ops *ops =
> - container_of(bridge->ops, struct pci_ecam_ops, pci_ops);
> + const struct pci_ecam_ops *ops =
> + container_of(bridge->ops, const struct pci_ecam_ops, pci_ops);
> unsigned int devfn_shift = ops->bus_shift - 8;
> void __iomem *base;
>
> diff --git a/xen/arch/arm/pci/pci-host-common.c b/xen/arch/arm/pci/pci-host-common.c
> index 6af845ab9d6c..1aad664b213e 100644
> --- a/xen/arch/arm/pci/pci-host-common.c
> +++ b/xen/arch/arm/pci/pci-host-common.c
> @@ -194,15 +194,13 @@ static int pci_bus_find_domain_nr(struct dt_device_node *dev)
> return domain;
> }
>
> -int pci_host_common_probe(struct dt_device_node *dev, const void *data)
> +int pci_host_common_probe(struct dt_device_node *dev,
> + const struct pci_ecam_ops *ops)
> {
> struct pci_host_bridge *bridge;
> struct pci_config_window *cfg;
> - struct pci_ecam_ops *ops;
> int err;
>
> - ops = (struct pci_ecam_ops *) data;
> -
> bridge = pci_alloc_host_bridge();
> if ( !bridge )
> return -ENOMEM;
> diff --git a/xen/include/asm-arm/pci.h b/xen/include/asm-arm/pci.h
> index 3d706fdd1d88..4199e0267d24 100644
> --- a/xen/include/asm-arm/pci.h
> +++ b/xen/include/asm-arm/pci.h
> @@ -65,7 +65,7 @@ struct pci_host_bridge {
> struct list_head node; /* Node in list of host bridges */
> uint16_t segment; /* Segment number */
> struct pci_config_window* cfg; /* Pointer to the bridge config window */
> - struct pci_ops *ops;
> + const struct pci_ops *ops;
> };
>
> struct pci_ops {
> @@ -94,7 +94,8 @@ struct pci_ecam_ops {
> /* Default ECAM ops */
> extern const struct pci_ecam_ops pci_generic_ecam_ops;
>
> -int pci_host_common_probe(struct dt_device_node *dev, const void *data);
> +int pci_host_common_probe(struct dt_device_node *dev,
> + const struct pci_ecam_ops *ops);
> int pci_generic_config_read(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
> uint32_t reg, uint32_t len, uint32_t *value);
> int pci_generic_config_write(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2021-11-17 11:13 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 6:33 [PATCH v6 0/7] PCI devices passthrough on Arm, part 2 Oleksandr Andrushchenko
2021-11-05 6:33 ` [PATCH v6 1/7] xen/arm: rename DEVICE_PCI to DEVICE_PCI_HOSTBRIDGE Oleksandr Andrushchenko
2021-11-16 18:26 ` Julien Grall
2021-11-05 6:33 ` [PATCH v6 2/7] xen/arm: add pci-domain for disabled devices Oleksandr Andrushchenko
2021-11-16 18:48 ` Julien Grall
2021-11-17 6:56 ` Oleksandr Andrushchenko
2021-11-17 21:33 ` Julien Grall
2021-11-18 7:13 ` Oleksandr Andrushchenko
2021-11-22 15:29 ` Julien Grall
2021-11-22 16:23 ` Oleksandr Andrushchenko
2021-11-22 17:17 ` Julien Grall
2021-11-23 6:31 ` Oleksandr Andrushchenko
2021-11-23 16:05 ` Julien Grall
2021-11-23 16:44 ` Oleksandr Andrushchenko
2021-11-23 17:15 ` Julien Grall
2021-11-24 6:54 ` Oleksandr Andrushchenko
2021-11-05 6:33 ` [PATCH v6 3/7] xen/arm: setup MMIO range trap handlers for hardware domain Oleksandr Andrushchenko
2021-11-09 9:20 ` Oleksandr Andrushchenko
2021-11-16 19:12 ` Julien Grall
2021-11-18 7:27 ` Oleksandr Andrushchenko
2021-11-18 10:46 ` Oleksandr Andrushchenko
2021-11-22 17:36 ` Julien Grall
2021-11-23 6:58 ` Oleksandr Andrushchenko
2021-11-23 16:12 ` Julien Grall
2021-11-23 16:41 ` Oleksandr Andrushchenko
2021-11-23 16:58 ` Julien Grall
2021-11-24 7:22 ` Oleksandr Andrushchenko
2021-11-05 6:33 ` [PATCH v6 4/7] xen/arm: do not map PCI ECAM and MMIO space to Domain-0's p2m Oleksandr Andrushchenko
2021-11-23 16:42 ` Julien Grall
2021-11-24 7:42 ` Oleksandr Andrushchenko
2021-11-05 6:33 ` [PATCH v6 5/7] xen/arm: do not map IRQs and memory for disabled devices Oleksandr Andrushchenko
2021-11-16 19:22 ` Julien Grall
2021-11-18 6:59 ` Oleksandr Andrushchenko
2021-11-22 19:31 ` Julien Grall
2021-11-23 7:23 ` Oleksandr Andrushchenko
2021-11-05 6:33 ` [PATCH v6 6/7] xen/arm: process pending vPCI map/unmap operations Oleksandr Andrushchenko
2021-11-05 7:40 ` Jan Beulich
2021-11-17 21:26 ` Julien Grall
2021-11-05 6:33 ` [PATCH v6 7/7] xen/arm: do not use void pointer in pci_host_common_probe Oleksandr Andrushchenko
2021-11-17 11:12 ` Rahul Singh [this message]
2021-11-17 21:45 ` Julien Grall
2021-11-18 7:34 ` Oleksandr Andrushchenko
2021-11-22 17:48 ` Julien Grall
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=96F5FCA2-D8EE-4DC3-8945-619887069C5E@arm.com \
--to=rahul.singh@arm.com \
--cc=Artem_Mygaiev@epam.com \
--cc=Bertrand.Marquis@arm.com \
--cc=andr2000@gmail.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=oleksandr_andrushchenko@epam.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=paul@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=volodymyr_babchuk@epam.com \
--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;
as well as URLs for NNTP newsgroup(s).