* [PATCH] drivers: eisa: make eisa_bus_type const
@ 2025-09-19 6:53 Adrian Barnaś
2025-09-19 15:39 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Adrian Barnaś @ 2025-09-19 6:53 UTC (permalink / raw)
To: Kees Cook, Alejandro Colomar, Greg Kroah-Hartman, linux-kernel
Cc: Adrian Barnaś
Because driver core can properly handle constant struct bus_type,
move the eisa_bus_type to be a constant structure as well, placing it into
read-only memory which can not be modified at runtime.
Signed-off-by: Adrian Barnaś <abarnas@google.com>
---
drivers/eisa/eisa-bus.c | 2 +-
include/linux/eisa.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index edceea083b98..bd76d599109c 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -135,7 +135,7 @@ static int eisa_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
return 0;
}
-struct bus_type eisa_bus_type = {
+const struct bus_type eisa_bus_type = {
.name = "eisa",
.match = eisa_bus_match,
.uevent = eisa_bus_uevent,
diff --git a/include/linux/eisa.h b/include/linux/eisa.h
index 21a2ecc1e538..cf55630b595b 100644
--- a/include/linux/eisa.h
+++ b/include/linux/eisa.h
@@ -68,7 +68,7 @@ struct eisa_driver {
/* These external functions are only available when EISA support is enabled. */
#ifdef CONFIG_EISA
-extern struct bus_type eisa_bus_type;
+extern const struct bus_type eisa_bus_type;
int eisa_driver_register (struct eisa_driver *edrv);
void eisa_driver_unregister (struct eisa_driver *edrv);
--
2.51.0.534.gc79095c0ca-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] drivers: eisa: make eisa_bus_type const
2025-09-19 6:53 [PATCH] drivers: eisa: make eisa_bus_type const Adrian Barnaś
@ 2025-09-19 15:39 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2025-09-19 15:39 UTC (permalink / raw)
To: Adrian Barnaś; +Cc: Kees Cook, Alejandro Colomar, linux-kernel
On Fri, Sep 19, 2025 at 06:53:27AM +0000, Adrian Barnaś wrote:
> Because driver core can properly handle constant struct bus_type,
> move the eisa_bus_type to be a constant structure as well, placing it into
> read-only memory which can not be modified at runtime.
>
> Signed-off-by: Adrian Barnaś <abarnas@google.com>
> ---
> drivers/eisa/eisa-bus.c | 2 +-
> include/linux/eisa.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-19 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 6:53 [PATCH] drivers: eisa: make eisa_bus_type const Adrian Barnaś
2025-09-19 15:39 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.