The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] pcmcia: ds: make pcmcia_bus_type const
@ 2024-02-13 14:48 Ricardo B. Marliere
  2024-02-13 17:27 ` Greg Kroah-Hartman
  2024-02-18 16:49 ` Dominik Brodowski
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-13 14:48 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the pcmcia_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@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/pcmcia/cs_internal.h | 2 +-
 drivers/pcmcia/ds.c          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 580369f3c0b0..999332bc4378 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -132,7 +132,7 @@ void pcmcia_put_socket(struct pcmcia_socket *skt);
  * Stuff internal to module "pcmcia".
  */
 /* ds.c */
-extern struct bus_type pcmcia_bus_type;
+extern const struct bus_type pcmcia_bus_type;
 
 struct pcmcia_device;
 
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index b4b8363d1de2..d3cfd353fb93 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -1406,7 +1406,7 @@ static const struct dev_pm_ops pcmcia_bus_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
 };
 
-struct bus_type pcmcia_bus_type = {
+const struct bus_type pcmcia_bus_type = {
 	.name = "pcmcia",
 	.uevent = pcmcia_bus_uevent,
 	.match = pcmcia_bus_match,

---
base-commit: 4f733de8b78a209501041a4b0a44c83ece0e8933
change-id: 20240213-bus_cleanup-pcmcia-c18794c076f3

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pcmcia: ds: make pcmcia_bus_type const
  2024-02-13 14:48 [PATCH] pcmcia: ds: make pcmcia_bus_type const Ricardo B. Marliere
@ 2024-02-13 17:27 ` Greg Kroah-Hartman
  2024-02-18 16:49 ` Dominik Brodowski
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-13 17:27 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Dominik Brodowski, linux-kernel

On Tue, Feb 13, 2024 at 11:48:45AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the pcmcia_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@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
>  drivers/pcmcia/cs_internal.h | 2 +-
>  drivers/pcmcia/ds.c          | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pcmcia: ds: make pcmcia_bus_type const
  2024-02-13 14:48 [PATCH] pcmcia: ds: make pcmcia_bus_type const Ricardo B. Marliere
  2024-02-13 17:27 ` Greg Kroah-Hartman
@ 2024-02-18 16:49 ` Dominik Brodowski
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Brodowski @ 2024-02-18 16:49 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: linux-kernel, Greg Kroah-Hartman

Am Tue, Feb 13, 2024 at 11:48:45AM -0300 schrieb Ricardo B. Marliere:
> Now that the driver core can properly handle constant struct bus_type,
> move the pcmcia_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@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

Applied to pcmcia-next.

Thanks,
	Dominik

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-18 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 14:48 [PATCH] pcmcia: ds: make pcmcia_bus_type const Ricardo B. Marliere
2024-02-13 17:27 ` Greg Kroah-Hartman
2024-02-18 16:49 ` Dominik Brodowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox