public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nubus: make nubus_bus_type static and constant
@ 2023-12-19 15:47 Greg Kroah-Hartman
  2023-12-20 22:18 ` Finn Thain
  2024-01-02  8:16 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2023-12-19 15:47 UTC (permalink / raw)
  To: fthain; +Cc: linux-kernel, Greg Kroah-Hartman, linux-m68k

Now that the driver core can properly handle constant struct bus_type,
move the nubus_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

It's also never used outside of drivers/nubus/bus.c so make it static
and don't export it as no one is using it.

Cc: Finn Thain <fthain@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/nubus/bus.c   | 3 +--
 include/linux/nubus.h | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
index 72921e4f35f6..12df4d88970c 100644
--- a/drivers/nubus/bus.c
+++ b/drivers/nubus/bus.c
@@ -32,12 +32,11 @@ static void nubus_device_remove(struct device *dev)
 		ndrv->remove(to_nubus_board(dev));
 }
 
-struct bus_type nubus_bus_type = {
+static const struct bus_type nubus_bus_type = {
 	.name		= "nubus",
 	.probe		= nubus_device_probe,
 	.remove		= nubus_device_remove,
 };
-EXPORT_SYMBOL(nubus_bus_type);
 
 int nubus_driver_register(struct nubus_driver *ndrv)
 {
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index bdcd85e622d8..4d103ac8f5c7 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -89,8 +89,6 @@ struct nubus_driver {
 	void (*remove)(struct nubus_board *board);
 };
 
-extern struct bus_type nubus_bus_type;
-
 /* Generic NuBus interface functions, modelled after the PCI interface */
 #ifdef CONFIG_PROC_FS
 extern bool nubus_populate_procfs;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nubus: make nubus_bus_type static and constant
  2023-12-19 15:47 [PATCH] nubus: make nubus_bus_type static and constant Greg Kroah-Hartman
@ 2023-12-20 22:18 ` Finn Thain
  2024-01-02  8:16 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Finn Thain @ 2023-12-20 22:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, linux-m68k


On Tue, 19 Dec 2023, Greg Kroah-Hartman wrote:

> Now that the driver core can properly handle constant struct bus_type,
> move the nubus_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
> 
> It's also never used outside of drivers/nubus/bus.c so make it static
> and don't export it as no one is using it.
> 
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Acked-by: Finn Thain <fthain@linux-m68k.org>

Thanks, Greg.

> ---
>  drivers/nubus/bus.c   | 3 +--
>  include/linux/nubus.h | 2 --
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c
> index 72921e4f35f6..12df4d88970c 100644
> --- a/drivers/nubus/bus.c
> +++ b/drivers/nubus/bus.c
> @@ -32,12 +32,11 @@ static void nubus_device_remove(struct device *dev)
>  		ndrv->remove(to_nubus_board(dev));
>  }
>  
> -struct bus_type nubus_bus_type = {
> +static const struct bus_type nubus_bus_type = {
>  	.name		= "nubus",
>  	.probe		= nubus_device_probe,
>  	.remove		= nubus_device_remove,
>  };
> -EXPORT_SYMBOL(nubus_bus_type);
>  
>  int nubus_driver_register(struct nubus_driver *ndrv)
>  {
> diff --git a/include/linux/nubus.h b/include/linux/nubus.h
> index bdcd85e622d8..4d103ac8f5c7 100644
> --- a/include/linux/nubus.h
> +++ b/include/linux/nubus.h
> @@ -89,8 +89,6 @@ struct nubus_driver {
>  	void (*remove)(struct nubus_board *board);
>  };
>  
> -extern struct bus_type nubus_bus_type;
> -
>  /* Generic NuBus interface functions, modelled after the PCI interface */
>  #ifdef CONFIG_PROC_FS
>  extern bool nubus_populate_procfs;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nubus: make nubus_bus_type static and constant
  2023-12-19 15:47 [PATCH] nubus: make nubus_bus_type static and constant Greg Kroah-Hartman
  2023-12-20 22:18 ` Finn Thain
@ 2024-01-02  8:16 ` Geert Uytterhoeven
  2024-01-02 13:34   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2024-01-02  8:16 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: fthain, linux-kernel, linux-m68k

On Tue, Dec 19, 2023 at 4:48 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the nubus_bus_type variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
>
> It's also never used outside of drivers/nubus/bus.c so make it static
> and don't export it as no one is using it.
>
> Cc: Finn Thain <fthain@linux-m68k.org>
> Cc: linux-m68k@lists.linux-m68k.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. will queue in the m68k for-v6.8 branch.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nubus: make nubus_bus_type static and constant
  2024-01-02  8:16 ` Geert Uytterhoeven
@ 2024-01-02 13:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-01-02 13:34 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: fthain, linux-kernel, linux-m68k

On Tue, Jan 02, 2024 at 09:16:23AM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 19, 2023 at 4:48 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > Now that the driver core can properly handle constant struct bus_type,
> > move the nubus_bus_type variable to be a constant structure as well,
> > placing it into read-only memory which can not be modified at runtime.
> >
> > It's also never used outside of drivers/nubus/bus.c so make it static
> > and don't export it as no one is using it.
> >
> > Cc: Finn Thain <fthain@linux-m68k.org>
> > Cc: linux-m68k@lists.linux-m68k.org
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> i.e. will queue in the m68k for-v6.8 branch.

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-02 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 15:47 [PATCH] nubus: make nubus_bus_type static and constant Greg Kroah-Hartman
2023-12-20 22:18 ` Finn Thain
2024-01-02  8:16 ` Geert Uytterhoeven
2024-01-02 13:34   ` 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