* [PATCH] mei: bus: constify the struct mei_cl_bus_type usage
@ 2024-04-23 2:41 Kunwu Chan
2024-04-23 19:45 ` Winkler, Tomas
0 siblings, 1 reply; 4+ messages in thread
From: Kunwu Chan @ 2024-04-23 2:41 UTC (permalink / raw)
To: tomas.winkler, arnd, gregkh, kunwu.chan; +Cc: linux-kernel, Kunwu Chan
Now that the driver core can properly handle constant struct bus_type,
move the mei_cl_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
drivers/misc/mei/bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index f9bcff197615..99393f610cdf 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -1327,7 +1327,7 @@ static int mei_cl_device_uevent(const struct device *dev, struct kobj_uevent_env
return 0;
}
-static struct bus_type mei_cl_bus_type = {
+static const struct bus_type mei_cl_bus_type = {
.name = "mei",
.dev_groups = mei_cldev_groups,
.match = mei_cl_device_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* RE: [PATCH] mei: bus: constify the struct mei_cl_bus_type usage
2024-04-23 2:41 [PATCH] mei: bus: constify the struct mei_cl_bus_type usage Kunwu Chan
@ 2024-04-23 19:45 ` Winkler, Tomas
2024-04-23 19:57 ` gregkh
0 siblings, 1 reply; 4+ messages in thread
From: Winkler, Tomas @ 2024-04-23 19:45 UTC (permalink / raw)
To: Kunwu Chan, arnd@arndb.de, gregkh@linuxfoundation.org,
kunwu.chan@hotmail.com
Cc: linux-kernel@vger.kernel.org
>
> Now that the driver core can properly handle constant struct bus_type,
> move the mei_cl_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
LGTM
> ---
> drivers/misc/mei/bus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index
> f9bcff197615..99393f610cdf 100644
> --- a/drivers/misc/mei/bus.c
> +++ b/drivers/misc/mei/bus.c
> @@ -1327,7 +1327,7 @@ static int mei_cl_device_uevent(const struct device
> *dev, struct kobj_uevent_env
> return 0;
> }
>
> -static struct bus_type mei_cl_bus_type = {
> +static const struct bus_type mei_cl_bus_type = {
> .name = "mei",
> .dev_groups = mei_cldev_groups,
> .match = mei_cl_device_match,
> --
> 2.40.1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mei: bus: constify the struct mei_cl_bus_type usage
2024-04-23 19:45 ` Winkler, Tomas
@ 2024-04-23 19:57 ` gregkh
2024-04-23 20:05 ` Winkler, Tomas
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2024-04-23 19:57 UTC (permalink / raw)
To: Winkler, Tomas
Cc: Kunwu Chan, arnd@arndb.de, kunwu.chan@hotmail.com,
linux-kernel@vger.kernel.org
On Tue, Apr 23, 2024 at 07:45:08PM +0000, Winkler, Tomas wrote:
>
> >
> > Now that the driver core can properly handle constant struct bus_type,
> > move the mei_cl_bus_type variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> >
> > Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> LGTM
Can you provide a "Acked-by:"?
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] mei: bus: constify the struct mei_cl_bus_type usage
2024-04-23 19:57 ` gregkh
@ 2024-04-23 20:05 ` Winkler, Tomas
0 siblings, 0 replies; 4+ messages in thread
From: Winkler, Tomas @ 2024-04-23 20:05 UTC (permalink / raw)
To: gregkh@linuxfoundation.org
Cc: Kunwu Chan, arnd@arndb.de, kunwu.chan@hotmail.com,
linux-kernel@vger.kernel.org
> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Tuesday, April 23, 2024 10:57 PM
> To: Winkler, Tomas <tomas.winkler@intel.com>
> Cc: Kunwu Chan <chentao@kylinos.cn>; arnd@arndb.de;
> kunwu.chan@hotmail.com; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] mei: bus: constify the struct mei_cl_bus_type usage
>
> On Tue, Apr 23, 2024 at 07:45:08PM +0000, Winkler, Tomas wrote:
> >
> > >
> > > Now that the driver core can properly handle constant struct
> > > bus_type, move the mei_cl_bus_type variable to be a constant
> > > structure as well, placing it into read-only memory which can not be
> modified at runtime.
> > >
> > > Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
> > LGTM
> Can you provide a "Acked-by:"?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-23 20:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 2:41 [PATCH] mei: bus: constify the struct mei_cl_bus_type usage Kunwu Chan
2024-04-23 19:45 ` Winkler, Tomas
2024-04-23 19:57 ` gregkh
2024-04-23 20:05 ` Winkler, Tomas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox