* [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const
2024-02-04 14:40 [PATCH 0/2] platform: x86: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-04 14:40 ` Ricardo B. Marliere
2024-02-05 17:02 ` Armin Wolf
2024-02-04 14:40 ` [PATCH 2/2] platform: x86: ibm_rtl: make rtl_subsys const Ricardo B. Marliere
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:40 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Greg Kroah-Hartman,
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,
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const
2024-02-04 14:40 ` [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const Ricardo B. Marliere
@ 2024-02-05 17:02 ` Armin Wolf
0 siblings, 0 replies; 6+ messages in thread
From: Armin Wolf @ 2024-02-05 17:02 UTC (permalink / raw)
To: Ricardo B. Marliere, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Greg Kroah-Hartman
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] platform: x86: ibm_rtl: make rtl_subsys const
2024-02-04 14:40 [PATCH 0/2] platform: x86: struct bus_type cleanup Ricardo B. Marliere
2024-02-04 14:40 ` [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const Ricardo B. Marliere
@ 2024-02-04 14:40 ` Ricardo B. Marliere
2024-02-04 14:52 ` [PATCH 0/2] platform: x86: struct bus_type cleanup Greg Kroah-Hartman
2024-02-06 10:14 ` Ilpo Järvinen
3 siblings, 0 replies; 6+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 14:40 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
Now that the driver core can properly handle constant struct bus_type,
move the rtl_subsys 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/ibm_rtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 2ab7d9ac542d..1d4bbae115f1 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -179,7 +179,7 @@ static ssize_t rtl_set_state(struct device *dev,
return ret;
}
-static struct bus_type rtl_subsys = {
+static const struct bus_type rtl_subsys = {
.name = "ibm_rtl",
.dev_name = "ibm_rtl",
};
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/2] platform: x86: struct bus_type cleanup
2024-02-04 14:40 [PATCH 0/2] platform: x86: struct bus_type cleanup Ricardo B. Marliere
2024-02-04 14:40 ` [PATCH 1/2] platform: x86: wmi: make wmi_bus_type const Ricardo B. Marliere
2024-02-04 14:40 ` [PATCH 2/2] platform: x86: ibm_rtl: make rtl_subsys const Ricardo B. Marliere
@ 2024-02-04 14:52 ` Greg Kroah-Hartman
2024-02-06 10:14 ` Ilpo Järvinen
3 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-04 14:52 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Armin Wolf, Hans de Goede, Ilpo Järvinen,
platform-driver-x86, linux-kernel
On Sun, Feb 04, 2024 at 11:40:15AM -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
>
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=bus_cleanup&id=26105f537f0c60eacfeb430abd2e05d7ddcdd8aa
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] platform: x86: struct bus_type cleanup
2024-02-04 14:40 [PATCH 0/2] platform: x86: struct bus_type cleanup Ricardo B. Marliere
` (2 preceding siblings ...)
2024-02-04 14:52 ` [PATCH 0/2] platform: x86: struct bus_type cleanup Greg Kroah-Hartman
@ 2024-02-06 10:14 ` Ilpo Järvinen
3 siblings, 0 replies; 6+ messages in thread
From: Ilpo Järvinen @ 2024-02-06 10:14 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ricardo B. Marliere
Cc: platform-driver-x86, linux-kernel, Greg Kroah-Hartman
On Sun, 04 Feb 2024 11:40:15 -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]). Specifically, this series is part of the task of
> splitting one of his TODOs [2].
>
Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/2] platform: x86: wmi: make wmi_bus_type const
commit: 10fdfd13a35994ac1dcc3003d4046cb1955e66a8
[2/2] platform: x86: ibm_rtl: make rtl_subsys const
commit: 41b43c75121208a9e4e84fd148f918bddb3f5d1f
--
i.
^ permalink raw reply [flat|nested] 6+ messages in thread