lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240213-bus_cleanup-cxl-v1-1-a601adabb391@marliere.net>
Date: Tue, 13 Feb 2024 11:46:59 -0300
From: "Ricardo B. Marliere" <ricardo@...liere.net>
To: Davidlohr Bueso <dave@...olabs.net>, 
 Jonathan Cameron <jonathan.cameron@...wei.com>, 
 Dave Jiang <dave.jiang@...el.com>, 
 Alison Schofield <alison.schofield@...el.com>, 
 Vishal Verma <vishal.l.verma@...el.com>, Ira Weiny <ira.weiny@...el.com>, 
 Dan Williams <dan.j.williams@...el.com>
Cc: linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 "Ricardo B. Marliere" <ricardo@...liere.net>
Subject: [PATCH] cxl/port: make cxl_bus_type const

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the cxl_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>
---
 drivers/cxl/core/port.c | 2 +-
 drivers/cxl/cxl.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index e59d9d37aa65..a73c1d1dd4c4 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -2197,7 +2197,7 @@ static const struct attribute_group *cxl_bus_attribute_groups[] = {
 	NULL,
 };
 
-struct bus_type cxl_bus_type = {
+const struct bus_type cxl_bus_type = {
 	.name = "cxl",
 	.uevent = cxl_bus_uevent,
 	.match = cxl_bus_match,
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index b6017c0c57b4..122015f7a558 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -803,7 +803,7 @@ int cxl_dvsec_rr_decode(struct device *dev, int dvsec,
 
 bool is_cxl_region(struct device *dev);
 
-extern struct bus_type cxl_bus_type;
+extern const struct bus_type cxl_bus_type;
 
 struct cxl_driver {
 	const char *name;

---
base-commit: 716f4aaa7b48a55c73d632d0657b35342b1fefd7
change-id: 20240213-bus_cleanup-cxl-ce6b8a16eb0b

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ