* [PATCH] input: gameport: make gameport_bus const
@ 2024-02-04 19:56 Ricardo B. Marliere
2024-02-05 12:49 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo B. Marliere @ 2024-02-04 19:56 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-input, linux-kernel, Greg Kroah-Hartman,
Ricardo B. Marliere
Now that the driver core can properly handle constant struct bus_type,
move the gameport_bus 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/input/gameport/gameport.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 34f416a3ebcb..cfcc81c47b50 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -38,7 +38,7 @@ static DEFINE_MUTEX(gameport_mutex);
static LIST_HEAD(gameport_list);
-static struct bus_type gameport_bus;
+static const struct bus_type gameport_bus;
static void gameport_add_port(struct gameport *gameport);
static void gameport_attach_driver(struct gameport_driver *drv);
@@ -813,7 +813,7 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv)
return !gameport_drv->ignore;
}
-static struct bus_type gameport_bus = {
+static const struct bus_type gameport_bus = {
.name = "gameport",
.dev_groups = gameport_device_groups,
.drv_groups = gameport_driver_groups,
---
base-commit: 7d0f351da46098b3bbb147f886f059473b84ff48
change-id: 20240204-bus_cleanup-input-76cc02d48361
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] input: gameport: make gameport_bus const
2024-02-04 19:56 [PATCH] input: gameport: make gameport_bus const Ricardo B. Marliere
@ 2024-02-05 12:49 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-05 12:49 UTC (permalink / raw)
To: Ricardo B. Marliere; +Cc: Dmitry Torokhov, linux-input, linux-kernel
On Sun, Feb 04, 2024 at 04:56:34PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the gameport_bus 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>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-05 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 19:56 [PATCH] input: gameport: make gameport_bus const Ricardo B. Marliere
2024-02-05 12:49 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).