Re: [PATCH v5 7/9] platform/wmi: Make wmi_bus_class const
From: Ilpo Järvinen
Date: Tue Jun 09 2026 - 07:37:13 EST
On Fri, 5 Jun 2026, Armin Wolf wrote:
> 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.
>
> Signed-off-by: Armin Wolf <W_Armin@xxxxxx>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
--
i.
> ---
> 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",
> };
>
>