[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fc541aa6-9a45-48ff-a394-630721da7d9e@linux.intel.com>
Date: Fri, 9 Feb 2024 11:53:12 -0800
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
To: "Ricardo B. Marliere" <ricardo@...liere.net>,
Bjorn Helgaas <bhelgaas@...gle.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] PCI: make pcie_port_bus_type const
On 2/8/24 11:41 AM, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the pcie_port_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@...liere.net>
> ---
Looks fine to me.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
> drivers/pci/pci-driver.c | 2 +-
> drivers/pci/pcie/portdrv.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index ec838f2e892e..a29098e24683 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -1705,7 +1705,7 @@ static int pcie_port_bus_match(struct device *dev, struct device_driver *drv)
> return 1;
> }
>
> -struct bus_type pcie_port_bus_type = {
> +const struct bus_type pcie_port_bus_type = {
> .name = "pci_express",
> .match = pcie_port_bus_match,
> };
> diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
> index 1f3803bde7ee..12c89ea0313b 100644
> --- a/drivers/pci/pcie/portdrv.h
> +++ b/drivers/pci/pcie/portdrv.h
> @@ -96,7 +96,7 @@ struct pcie_port_service_driver {
> int pcie_port_service_register(struct pcie_port_service_driver *new);
> void pcie_port_service_unregister(struct pcie_port_service_driver *new);
>
> -extern struct bus_type pcie_port_bus_type;
> +extern const struct bus_type pcie_port_bus_type;
>
> struct pci_dev;
>
>
> ---
> base-commit: cc24b2d080dca2ce1c89a8a71c00bdf21155f357
> change-id: 20240208-bus_cleanup-pci2-61fe9c495d08
>
> Best regards,
--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer
Powered by blists - more mailing lists