Skip to contentSkip to conversation

hwtracing: intel_th: make intel_th_bus const

PATCH In review Adrian Barnaś 2 participants 2 messages Sep 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwtracing: intel_th: make intel_th_bus const

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

---
 drivers/hwtracing/intel_th/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/core.c +1 -1
index 47d9e6c3bac0..ba7c8b184cbc 100644
@@ -166,7 +166,7 @@ static void intel_th_remove(struct device *dev)
 	pm_runtime_enable(dev);
 }
 
-static struct bus_type intel_th_bus = {
+static const struct bus_type intel_th_bus = {
 	.name		= "intel_th",
 	.match		= intel_th_match,
 	.probe		= intel_th_probe,
Signature · 1 line
2.51.0.470.ga7dc726c21-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Adrian Barnaś

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

---
 drivers/hwtracing/intel_th/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/core.c +1 -1
index 47d9e6c3bac0..ba7c8b184cbc 100644
@@ -166,7 +166,7 @@ static void intel_th_remove(struct device *dev)
 	pm_runtime_enable(dev);
 }
 
-static struct bus_type intel_th_bus = {
+static const struct bus_type intel_th_bus = {
 	.name		= "intel_th",
 	.match		= intel_th_match,
 	.probe		= intel_th_probe,
Signature · 1 line
2.51.0.470.ga7dc726c21-goog