All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] peci: Make peci_bus_type const
@ 2024-02-10 15:10 ` Ricardo B. Marliere
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-10 15:10 UTC (permalink / raw
  To: Iwona Winiarska
  Cc: openbmc, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere

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

diff --git a/drivers/peci/core.c b/drivers/peci/core.c
index 0f83a9c6093b..b2f8db967e9b 100644
--- a/drivers/peci/core.c
+++ b/drivers/peci/core.c
@@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
 		driver->remove(device);
 }
 
-struct bus_type peci_bus_type = {
+const struct bus_type peci_bus_type = {
 	.name		= "peci",
 	.match		= peci_bus_device_match,
 	.probe		= peci_bus_device_probe,
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 9d75ea54504c..8a896c256c5f 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
 int peci_device_create(struct peci_controller *controller, u8 addr);
 void peci_device_destroy(struct peci_device *device);
 
-extern struct bus_type peci_bus_type;
+extern const struct bus_type peci_bus_type;
 extern const struct attribute_group *peci_bus_groups[];
 
 /**

---
base-commit: 047371968ffc470769f541d6933e262dc7085456
change-id: 20240210-bus_cleanup-peci-0933c629d58b

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


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

* [PATCH] peci: Make peci_bus_type const
@ 2024-02-10 15:10 ` Ricardo B. Marliere
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-10 15:10 UTC (permalink / raw
  To: Iwona Winiarska
  Cc: Greg Kroah-Hartman, openbmc, linux-kernel, Ricardo B. Marliere

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

diff --git a/drivers/peci/core.c b/drivers/peci/core.c
index 0f83a9c6093b..b2f8db967e9b 100644
--- a/drivers/peci/core.c
+++ b/drivers/peci/core.c
@@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
 		driver->remove(device);
 }
 
-struct bus_type peci_bus_type = {
+const struct bus_type peci_bus_type = {
 	.name		= "peci",
 	.match		= peci_bus_device_match,
 	.probe		= peci_bus_device_probe,
diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
index 9d75ea54504c..8a896c256c5f 100644
--- a/drivers/peci/internal.h
+++ b/drivers/peci/internal.h
@@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
 int peci_device_create(struct peci_controller *controller, u8 addr);
 void peci_device_destroy(struct peci_device *device);
 
-extern struct bus_type peci_bus_type;
+extern const struct bus_type peci_bus_type;
 extern const struct attribute_group *peci_bus_groups[];
 
 /**

---
base-commit: 047371968ffc470769f541d6933e262dc7085456
change-id: 20240210-bus_cleanup-peci-0933c629d58b

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


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

* Re: [PATCH] peci: Make peci_bus_type const
  2024-02-10 15:10 ` Ricardo B. Marliere
  (?)
@ 2024-02-14 13:58 ` Winiarska, Iwona
  -1 siblings, 0 replies; 3+ messages in thread
From: Winiarska, Iwona @ 2024-02-14 13:58 UTC (permalink / raw
  To: ricardo@marliere.net
  Cc: gregkh@linuxfoundation.org, openbmc@lists.ozlabs.org,
	linux-kernel@vger.kernel.org

On Sat, 2024-02-10 at 12:10 -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the peci_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: Iwona Winiarska <iwona.winiarska@intel.com>

Thanks
-Iwona

> ---
>  drivers/peci/core.c     | 2 +-
>  drivers/peci/internal.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/peci/core.c b/drivers/peci/core.c
> index 0f83a9c6093b..b2f8db967e9b 100644
> --- a/drivers/peci/core.c
> +++ b/drivers/peci/core.c
> @@ -201,7 +201,7 @@ static void peci_bus_device_remove(struct device *dev)
>  		driver->remove(device);
>  }
>  
> -struct bus_type peci_bus_type = {
> +const struct bus_type peci_bus_type = {
>  	.name		= "peci",
>  	.match		= peci_bus_device_match,
>  	.probe		= peci_bus_device_probe,
> diff --git a/drivers/peci/internal.h b/drivers/peci/internal.h
> index 9d75ea54504c..8a896c256c5f 100644
> --- a/drivers/peci/internal.h
> +++ b/drivers/peci/internal.h
> @@ -81,7 +81,7 @@ extern const struct attribute_group *peci_device_groups[];
>  int peci_device_create(struct peci_controller *controller, u8 addr);
>  void peci_device_destroy(struct peci_device *device);
>  
> -extern struct bus_type peci_bus_type;
> +extern const struct bus_type peci_bus_type;
>  extern const struct attribute_group *peci_bus_groups[];
>  
>  /**
> 
> ---
> base-commit: 047371968ffc470769f541d6933e262dc7085456
> change-id: 20240210-bus_cleanup-peci-0933c629d58b
> 
> Best regards,


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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-10 15:10 [PATCH] peci: Make peci_bus_type const Ricardo B. Marliere
2024-02-10 15:10 ` Ricardo B. Marliere
2024-02-14 13:58 ` Winiarska, Iwona

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.