From b79ad5e8ba5cfda93a83e0cf71d4743829cc9f83 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Wed, 10 Jun 2026 22:34:51 +0200 Subject: [PATCH] platform/wmi: Make wmi_bus_class const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Armin Wolf Reviewed-by: Mario Limonciello Link: https://patch.msgid.link/20260610203453.816254-8-W_Armin@gmx.de Signed-off-by: Ilpo Järvinen --- drivers/platform/wmi/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c index 5a2ffcbab6af..0782ebc33c00 100644 --- a/drivers/platform/wmi/core.c +++ b/drivers/platform/wmi/core.c @@ -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", };