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: <20240210-bus_cleanup-peci-v1-1-1e64bef6efc0@marliere.net>
Date: Sat, 10 Feb 2024 12:10:14 -0300
From: "Ricardo B. Marliere" <ricardo@...liere.net>
To: Iwona Winiarska <iwona.winiarska@...el.com>
Cc: openbmc@...ts.ozlabs.org, linux-kernel@...r.kernel.org, 
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 "Ricardo B. Marliere" <ricardo@...liere.net>
Subject: [PATCH] peci: Make peci_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the peci_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/peci/core.c     | 2 +-
 drivers/peci/internal.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/peci/core.c b/drivers/peci/core.c
index 0f83a9c6093b..b2f8db967e9b 100644
--- a/drivers/peci/core.c
+++ b/drivers/peci/core.c
@@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
 		driver->remove(device);
 }
 
-struct bus_type peci_bus_type = {
+const struct bus_type peci_bus_type = {
 	.name		= "peci",
 	.match		= peci_bus_device_match,
 	.probe		= peci_bus_device_probe,
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 9d75ea54504c..8a896c256c5f 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
 int peci_device_create(struct peci_controller *controller, u8 addr);
 void peci_device_destroy(struct peci_device *device);
 
-extern struct bus_type peci_bus_type;
+extern const struct bus_type peci_bus_type;
 extern const struct attribute_group *peci_bus_groups[];
 
 /**

---
base-commit: 047371968ffc470769f541d6933e262dc7085456
change-id: 20240210-bus_cleanup-peci-0933c629d58b

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ