]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/wmi: Make wmi_bus_class const
authorArmin Wolf <W_Armin@gmx.de>
Wed, 10 Jun 2026 20:34:51 +0000 (22:34 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 12 Jun 2026 13:01:52 +0000 (16:01 +0300)
The functions class_register()/_unregister() and device_create()
both support taking a const pointer to the class struct. Use this
to mark wmi_bus_class as const so that it can be placed into
read-only memory for better security.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20260610203453.816254-8-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/wmi/core.c

index 5a2ffcbab6af25acb6fc0e6c3b5c5169db2bf1e7..0782ebc33c00ddce0af6d5602bf7c37ffa4c5b4e 100644 (file)
@@ -1088,7 +1088,7 @@ static void wmi_dev_shutdown(struct device *dev)
        }
 }
 
-static struct class wmi_bus_class = {
+static const struct class wmi_bus_class = {
        .name = "wmi_bus",
 };