public inbox for linux-parisc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parisc: make parisc_bus_type const
@ 2024-02-13 14:38 Ricardo B. Marliere
  2024-02-13 17:29 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-13 14:38 UTC (permalink / raw)
  To: James E.J. Bottomley, Helge Deller
  Cc: linux-parisc, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the parisc_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>
---
 arch/parisc/include/asm/parisc-device.h | 2 +-
 arch/parisc/kernel/drivers.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/parisc/include/asm/parisc-device.h b/arch/parisc/include/asm/parisc-device.h
index 4de3b391d812..7ddd7f433367 100644
--- a/arch/parisc/include/asm/parisc-device.h
+++ b/arch/parisc/include/asm/parisc-device.h
@@ -61,7 +61,7 @@ parisc_get_drvdata(struct parisc_device *d)
 	return dev_get_drvdata(&d->dev);
 }
 
-extern struct bus_type parisc_bus_type;
+extern const struct bus_type parisc_bus_type;
 
 int iosapic_serial_irq(struct parisc_device *dev);
 
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index c7ff339732ba..ac19d685e4a5 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -618,7 +618,7 @@ static struct attribute *parisc_device_attrs[] = {
 };
 ATTRIBUTE_GROUPS(parisc_device);
 
-struct bus_type parisc_bus_type = {
+const struct bus_type parisc_bus_type = {
 	.name = "parisc",
 	.match = parisc_generic_match,
 	.uevent = parisc_uevent,

---
base-commit: 82b143aeb169b8b55798d7d2063032e1a6ceeeb0
change-id: 20240213-bus_cleanup-parisc-93098359acbe

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


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

* Re: [PATCH] parisc: make parisc_bus_type const
  2024-02-13 14:38 [PATCH] parisc: make parisc_bus_type const Ricardo B. Marliere
@ 2024-02-13 17:29 ` Greg Kroah-Hartman
  2024-02-16 13:58   ` Helge Deller
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-13 17:29 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: James E.J. Bottomley, Helge Deller, linux-parisc, linux-kernel

On Tue, Feb 13, 2024 at 11:38:02AM -0300, Ricardo B. Marliere wrote:
> Since commit d492cc2573a0 ("driver core: device.h: make struct
> bus_type a const *"), the driver core can properly handle constant
> struct bus_type, move the parisc_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>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH] parisc: make parisc_bus_type const
  2024-02-13 17:29 ` Greg Kroah-Hartman
@ 2024-02-16 13:58   ` Helge Deller
  0 siblings, 0 replies; 3+ messages in thread
From: Helge Deller @ 2024-02-16 13:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Ricardo B. Marliere
  Cc: James E.J. Bottomley, linux-parisc, linux-kernel

On 2/13/24 18:29, Greg Kroah-Hartman wrote:
> On Tue, Feb 13, 2024 at 11:38:02AM -0300, Ricardo B. Marliere wrote:
>> Since commit d492cc2573a0 ("driver core: device.h: make struct
>> bus_type a const *"), the driver core can properly handle constant
>> struct bus_type, move the parisc_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>
>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

applied to parisc git tree.

Thanks!
Helge



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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 14:38 [PATCH] parisc: make parisc_bus_type const Ricardo B. Marliere
2024-02-13 17:29 ` Greg Kroah-Hartman
2024-02-16 13:58   ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox