[v2,02/15] bus/pci: add const to some experimental API
Checks
Commit Message
Those functions are fine with a const on the device pointer.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/bus/pci/pci_common.c | 4 ++--
drivers/bus/pci/rte_bus_pci.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
Comments
On Mon, Aug 21, 2023 at 01:35:35PM +0200, David Marchand wrote:
> Those functions are fine with a const on the device pointer.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, August 21, 2023 7:36 PM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; ferruh.yigit@amd.com; Xia, Chenbo
> <chenbo.xia@intel.com>; nipun.gupta@amd.com; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [PATCH v2 02/15] bus/pci: add const to some experimental API
>
> Those functions are fine with a const on the device pointer.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/bus/pci/pci_common.c | 4 ++--
> drivers/bus/pci/rte_bus_pci.h | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index 52404ab0fe..382b0b8946 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -814,7 +814,7 @@ rte_pci_get_iommu_class(void)
> }
>
> off_t
> -rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap)
> +rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t
> cap)
> {
> off_t offset = RTE_PCI_CFG_SPACE_SIZE;
> uint32_t header;
> @@ -857,7 +857,7 @@ rte_pci_find_ext_capability(struct rte_pci_device *dev,
> uint32_t cap)
> }
>
> int
> -rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable)
> +rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable)
> {
> uint16_t old_cmd, cmd;
>
> diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h
> index 9d59c4aef3..75d0030eae 100644
> --- a/drivers/bus/pci/rte_bus_pci.h
> +++ b/drivers/bus/pci/rte_bus_pci.h
> @@ -85,7 +85,7 @@ void rte_pci_dump(FILE *f);
> * = 0: Device does not support it.
> */
> __rte_experimental
> -off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t
> cap);
> +off_t rte_pci_find_ext_capability(const struct rte_pci_device *dev,
> uint32_t cap);
>
> /**
> * Enables/Disables Bus Master for device's PCI command register.
> @@ -99,7 +99,7 @@ off_t rte_pci_find_ext_capability(struct rte_pci_device
> *dev, uint32_t cap);
> * 0 on success, -1 on error in PCI config space read/write.
> */
> __rte_experimental
> -int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
> +int rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable);
>
> /**
> * Read PCI config space.
> --
> 2.41.0
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
@@ -814,7 +814,7 @@ rte_pci_get_iommu_class(void)
}
off_t
-rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap)
+rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap)
{
off_t offset = RTE_PCI_CFG_SPACE_SIZE;
uint32_t header;
@@ -857,7 +857,7 @@ rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap)
}
int
-rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable)
+rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable)
{
uint16_t old_cmd, cmd;
@@ -85,7 +85,7 @@ void rte_pci_dump(FILE *f);
* = 0: Device does not support it.
*/
__rte_experimental
-off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap);
+off_t rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap);
/**
* Enables/Disables Bus Master for device's PCI command register.
@@ -99,7 +99,7 @@ off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap);
* 0 on success, -1 on error in PCI config space read/write.
*/
__rte_experimental
-int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
+int rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable);
/**
* Read PCI config space.