lkml.org 
[lkml]   [2024]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const
From
Am 04.02.24 um 15:40 schrieb Ricardo B. Marliere:

> Now that the driver core can properly handle constant struct bus_type,
> move the wmi_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@linuxfoundation.org>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
> ---
> drivers/platform/x86/wmi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 7ef1e82dc61c..859dfff515d0 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -219,7 +219,7 @@ static int wmidev_match_guid(struct device *dev, const void *data)
> return 0;
> }
>
> -static struct bus_type wmi_bus_type;
> +static const struct bus_type wmi_bus_type;
>
> static struct wmi_device *wmi_find_device_by_guid(const char *guid_string)
> {
> @@ -899,7 +899,7 @@ static struct class wmi_bus_class = {
> .name = "wmi_bus",
> };
>
> -static struct bus_type wmi_bus_type = {
> +static const struct bus_type wmi_bus_type = {
> .name = "wmi",
> .dev_groups = wmi_groups,
> .match = wmi_dev_match,
>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>


\
 
 \ /
  Last update: 2024-05-27 14:49    [W:0.135 / U:1.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site