linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thunderbolt: make tb_bus_type const
@ 2023-12-19 15:43 Greg Kroah-Hartman
  2023-12-19 18:01 ` Mika Westerberg
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-12-19 15:43 UTC (permalink / raw)
  To: mika.westerberg
  Cc: linux-kernel, Greg Kroah-Hartman, Andreas Noever, Michael Jamet,
	Yehezkel Bernat, linux-usb

Now that the driver core can properly handle constant struct bus_type,
move the tb_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/thunderbolt/domain.c | 2 +-
 include/linux/thunderbolt.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c
index ec7b5f65804e..9fb1a64f3300 100644
--- a/drivers/thunderbolt/domain.c
+++ b/drivers/thunderbolt/domain.c
@@ -307,7 +307,7 @@ static const struct attribute_group *domain_attr_groups[] = {
 	NULL,
 };
 
-struct bus_type tb_bus_type = {
+const struct bus_type tb_bus_type = {
 	.name = "thunderbolt",
 	.match = tb_service_match,
 	.probe = tb_service_probe,
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h
index 6151c210d987..2c835e5c41f6 100644
--- a/include/linux/thunderbolt.h
+++ b/include/linux/thunderbolt.h
@@ -86,7 +86,7 @@ struct tb {
 	unsigned long privdata[];
 };
 
-extern struct bus_type tb_bus_type;
+extern const struct bus_type tb_bus_type;
 extern struct device_type tb_service_type;
 extern struct device_type tb_xdomain_type;
 
-- 
2.43.0


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

* Re: [PATCH] thunderbolt: make tb_bus_type const
  2023-12-19 15:43 [PATCH] thunderbolt: make tb_bus_type const Greg Kroah-Hartman
@ 2023-12-19 18:01 ` Mika Westerberg
  2023-12-19 18:12   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Mika Westerberg @ 2023-12-19 18:01 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Andreas Noever, Michael Jamet, Yehezkel Bernat,
	linux-usb

On Tue, Dec 19, 2023 at 04:43:05PM +0100, Greg Kroah-Hartman wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the tb_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
> 
> Cc: Andreas Noever <andreas.noever@gmail.com>
> Cc: Michael Jamet <michael.jamet@intel.com>
> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Or you want me to pick it up?

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

* Re: [PATCH] thunderbolt: make tb_bus_type const
  2023-12-19 18:01 ` Mika Westerberg
@ 2023-12-19 18:12   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-12-19 18:12 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: linux-kernel, Andreas Noever, Michael Jamet, Yehezkel Bernat,
	linux-usb

On Tue, Dec 19, 2023 at 08:01:02PM +0200, Mika Westerberg wrote:
> On Tue, Dec 19, 2023 at 04:43:05PM +0100, Greg Kroah-Hartman wrote:
> > Now that the driver core can properly handle constant struct bus_type,
> > move the tb_bus_type variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> > 
> > Cc: Andreas Noever <andreas.noever@gmail.com>
> > Cc: Michael Jamet <michael.jamet@intel.com>
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Or you want me to pick it up?
> 

I can, thanks!

greg k-h

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

end of thread, other threads:[~2023-12-19 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 15:43 [PATCH] thunderbolt: make tb_bus_type const Greg Kroah-Hartman
2023-12-19 18:01 ` Mika Westerberg
2023-12-19 18:12   ` Greg Kroah-Hartman

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).