linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] firmware: struct bus_type cleanup
@ 2024-02-11 15:51 Ricardo B. Marliere
  2024-02-11 15:51 ` [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const Ricardo B. Marliere
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-11 15:51 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi
  Cc: linux-arm-kernel, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

This series is part of an effort to cleanup the users of the driver
core, as can be seen in many recent patches authored by Greg across the
tree (e.g. [1]).

---
[1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

---
Ricardo B. Marliere (2):
      firmware: arm_ffa: Make ffa_bus_type const
      firmware: arm_scmi: make scmi_bus_type const

 drivers/firmware/arm_ffa/bus.c     | 2 +-
 drivers/firmware/arm_scmi/bus.c    | 2 +-
 drivers/firmware/arm_scmi/common.h | 2 +-
 include/linux/arm_ffa.h            | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
---
base-commit: 047371968ffc470769f541d6933e262dc7085456
change-id: 20240211-bus_cleanup-firmware2-f5a633107921

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const
  2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
@ 2024-02-11 15:51 ` Ricardo B. Marliere
  2024-02-13  8:57   ` Cristian Marussi
  2024-02-11 15:51 ` [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const Ricardo B. Marliere
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-11 15:51 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi
  Cc: linux-arm-kernel, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the ffa_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>
---
 drivers/firmware/arm_ffa/bus.c | 2 +-
 include/linux/arm_ffa.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c
index 1c7940ba5539..2f557e90f2eb 100644
--- a/drivers/firmware/arm_ffa/bus.c
+++ b/drivers/firmware/arm_ffa/bus.c
@@ -105,7 +105,7 @@ static struct attribute *ffa_device_attributes_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ffa_device_attributes);
 
-struct bus_type ffa_bus_type = {
+const struct bus_type ffa_bus_type = {
 	.name		= "arm_ffa",
 	.match		= ffa_device_match,
 	.probe		= ffa_device_probe,
diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h
index 3d0fde57ba90..c906f666ff5d 100644
--- a/include/linux/arm_ffa.h
+++ b/include/linux/arm_ffa.h
@@ -209,7 +209,7 @@ bool ffa_device_is_valid(struct ffa_device *ffa_dev) { return false; }
 #define module_ffa_driver(__ffa_driver)	\
 	module_driver(__ffa_driver, ffa_register, ffa_unregister)
 
-extern struct bus_type ffa_bus_type;
+extern const struct bus_type ffa_bus_type;
 
 /* FFA transport related */
 struct ffa_partition_info {

-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const
  2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
  2024-02-11 15:51 ` [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const Ricardo B. Marliere
@ 2024-02-11 15:51 ` Ricardo B. Marliere
  2024-02-13  8:57   ` Cristian Marussi
  2024-02-12 10:46 ` [PATCH 0/2] firmware: struct bus_type cleanup Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Ricardo B. Marliere @ 2024-02-11 15:51 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi
  Cc: linux-arm-kernel, linux-kernel, Greg Kroah-Hartman,
	Ricardo B. Marliere

Now that the driver core can properly handle constant struct bus_type,
move the scmi_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>
---
 drivers/firmware/arm_scmi/bus.c    | 2 +-
 drivers/firmware/arm_scmi/common.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index c15928b8c5cc..609a6496c1d4 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -263,7 +263,7 @@ static void scmi_dev_remove(struct device *dev)
 		scmi_drv->remove(scmi_dev);
 }
 
-struct bus_type scmi_bus_type = {
+const struct bus_type scmi_bus_type = {
 	.name =	"scmi_protocol",
 	.match = scmi_dev_match,
 	.probe = scmi_dev_probe,
diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
index 00b165d1f502..6affbfdd1dec 100644
--- a/drivers/firmware/arm_scmi/common.h
+++ b/drivers/firmware/arm_scmi/common.h
@@ -141,7 +141,7 @@ scmi_revision_area_get(const struct scmi_protocol_handle *ph);
 void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
 				     u8 *prot_imp);
 
-extern struct bus_type scmi_bus_type;
+extern const struct bus_type scmi_bus_type;
 
 #define SCMI_BUS_NOTIFY_DEVICE_REQUEST		0
 #define SCMI_BUS_NOTIFY_DEVICE_UNREQUEST	1

-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] firmware: struct bus_type cleanup
  2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
  2024-02-11 15:51 ` [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const Ricardo B. Marliere
  2024-02-11 15:51 ` [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const Ricardo B. Marliere
@ 2024-02-12 10:46 ` Greg Kroah-Hartman
  2024-02-22  7:38 ` Sudeep Holla
  2024-02-22  9:07 ` Sudeep Holla
  4 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-12 10:46 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Sudeep Holla, Cristian Marussi, linux-arm-kernel, linux-kernel

On Sun, Feb 11, 2024 at 12:51:28PM -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]).
> 
> ---
> [1]: https://lore.kernel.org/lkml/?q=f%3Agregkh%40linuxfoundation.org+s%3A%22make%22+and+s%3A%22const%22
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const
  2024-02-11 15:51 ` [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const Ricardo B. Marliere
@ 2024-02-13  8:57   ` Cristian Marussi
  0 siblings, 0 replies; 8+ messages in thread
From: Cristian Marussi @ 2024-02-13  8:57 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Sudeep Holla, linux-arm-kernel, linux-kernel, Greg Kroah-Hartman

On Sun, Feb 11, 2024 at 12:51:29PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the ffa_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: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian

> ---
>  drivers/firmware/arm_ffa/bus.c | 2 +-
>  include/linux/arm_ffa.h        | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c
> index 1c7940ba5539..2f557e90f2eb 100644
> --- a/drivers/firmware/arm_ffa/bus.c
> +++ b/drivers/firmware/arm_ffa/bus.c
> @@ -105,7 +105,7 @@ static struct attribute *ffa_device_attributes_attrs[] = {
>  };
>  ATTRIBUTE_GROUPS(ffa_device_attributes);
>  
> -struct bus_type ffa_bus_type = {
> +const struct bus_type ffa_bus_type = {
>  	.name		= "arm_ffa",
>  	.match		= ffa_device_match,
>  	.probe		= ffa_device_probe,
> diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h
> index 3d0fde57ba90..c906f666ff5d 100644
> --- a/include/linux/arm_ffa.h
> +++ b/include/linux/arm_ffa.h
> @@ -209,7 +209,7 @@ bool ffa_device_is_valid(struct ffa_device *ffa_dev) { return false; }
>  #define module_ffa_driver(__ffa_driver)	\
>  	module_driver(__ffa_driver, ffa_register, ffa_unregister)
>  
> -extern struct bus_type ffa_bus_type;
> +extern const struct bus_type ffa_bus_type;
>  
>  /* FFA transport related */
>  struct ffa_partition_info {
> 
> -- 
> 2.43.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const
  2024-02-11 15:51 ` [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const Ricardo B. Marliere
@ 2024-02-13  8:57   ` Cristian Marussi
  0 siblings, 0 replies; 8+ messages in thread
From: Cristian Marussi @ 2024-02-13  8:57 UTC (permalink / raw)
  To: Ricardo B. Marliere
  Cc: Sudeep Holla, linux-arm-kernel, linux-kernel, Greg Kroah-Hartman

On Sun, Feb 11, 2024 at 12:51:30PM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the scmi_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: Cristian Marussi <cristian.marussi@arm.com>

Thanks,
Cristian

>  drivers/firmware/arm_scmi/bus.c    | 2 +-
>  drivers/firmware/arm_scmi/common.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index c15928b8c5cc..609a6496c1d4 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -263,7 +263,7 @@ static void scmi_dev_remove(struct device *dev)
>  		scmi_drv->remove(scmi_dev);
>  }
>  
> -struct bus_type scmi_bus_type = {
> +const struct bus_type scmi_bus_type = {
>  	.name =	"scmi_protocol",
>  	.match = scmi_dev_match,
>  	.probe = scmi_dev_probe,
> diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> index 00b165d1f502..6affbfdd1dec 100644
> --- a/drivers/firmware/arm_scmi/common.h
> +++ b/drivers/firmware/arm_scmi/common.h
> @@ -141,7 +141,7 @@ scmi_revision_area_get(const struct scmi_protocol_handle *ph);
>  void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
>  				     u8 *prot_imp);
>  
> -extern struct bus_type scmi_bus_type;
> +extern const struct bus_type scmi_bus_type;
>  
>  #define SCMI_BUS_NOTIFY_DEVICE_REQUEST		0
>  #define SCMI_BUS_NOTIFY_DEVICE_UNREQUEST	1
> 
> -- 
> 2.43.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] firmware: struct bus_type cleanup
  2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
                   ` (2 preceding siblings ...)
  2024-02-12 10:46 ` [PATCH 0/2] firmware: struct bus_type cleanup Greg Kroah-Hartman
@ 2024-02-22  7:38 ` Sudeep Holla
  2024-02-22  9:07 ` Sudeep Holla
  4 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2024-02-22  7:38 UTC (permalink / raw)
  To: Cristian Marussi, Ricardo B. Marliere
  Cc: Sudeep Holla, linux-arm-kernel, linux-kernel, Greg Kroah-Hartman

On Sun, 11 Feb 2024 12:51:28 -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]).
> 

Applied to sudeep.holla/linux (for-next/ffa/updates), thanks!

[1/2] firmware: arm_ffa: Make ffa_bus_type const
      https://git.kernel.org/sudeep.holla/c/989e8661dc45
--
Regards,
Sudeep


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] firmware: struct bus_type cleanup
  2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
                   ` (3 preceding siblings ...)
  2024-02-22  7:38 ` Sudeep Holla
@ 2024-02-22  9:07 ` Sudeep Holla
  4 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2024-02-22  9:07 UTC (permalink / raw)
  To: Cristian Marussi, Ricardo B. Marliere
  Cc: Sudeep Holla, linux-arm-kernel, linux-kernel, Greg Kroah-Hartman

On Sun, 11 Feb 2024 12:51:28 -0300, Ricardo B. Marliere wrote:
> This series is part of an effort to cleanup the users of the driver
> core, as can be seen in many recent patches authored by Greg across the
> tree (e.g. [1]).
> 

Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!

[2/2] firmware: arm_scmi: make scmi_bus_type const
      https://git.kernel.org/sudeep.holla/c/961745b2c42e
--
Regards,
Sudeep


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-02-22  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-11 15:51 [PATCH 0/2] firmware: struct bus_type cleanup Ricardo B. Marliere
2024-02-11 15:51 ` [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const Ricardo B. Marliere
2024-02-13  8:57   ` Cristian Marussi
2024-02-11 15:51 ` [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const Ricardo B. Marliere
2024-02-13  8:57   ` Cristian Marussi
2024-02-12 10:46 ` [PATCH 0/2] firmware: struct bus_type cleanup Greg Kroah-Hartman
2024-02-22  7:38 ` Sudeep Holla
2024-02-22  9:07 ` Sudeep Holla

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).