All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmem: core: make nvmem_layout_bus_type const
@ 2024-02-14 19:04 Ricardo B. Marliere
  2024-02-15  7:49 ` Greg Kroah-Hartman
  2024-02-21  7:10 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo B. Marliere @ 2024-02-14 19:04 UTC (permalink / raw)
  To: Srinivas Kandagatla; +Cc: 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 nvmem_layout_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/nvmem/layouts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c
index 6a6aa58369ff..8b5e2de138eb 100644
--- a/drivers/nvmem/layouts.c
+++ b/drivers/nvmem/layouts.c
@@ -45,7 +45,7 @@ static void nvmem_layout_bus_remove(struct device *dev)
 	return drv->remove(layout);
 }
 
-static struct bus_type nvmem_layout_bus_type = {
+static const struct bus_type nvmem_layout_bus_type = {
 	.name		= "nvmem-layout",
 	.match		= nvmem_layout_bus_match,
 	.probe		= nvmem_layout_bus_probe,

---
base-commit: 2c8df24cc166478910c4e9e870adf44d157330fa
change-id: 20240214-bus_cleanup-nvmem2-b77804172a0b

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


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

* Re: [PATCH] nvmem: core: make nvmem_layout_bus_type const
  2024-02-14 19:04 [PATCH] nvmem: core: make nvmem_layout_bus_type const Ricardo B. Marliere
@ 2024-02-15  7:49 ` Greg Kroah-Hartman
  2024-02-21  7:10 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-15  7:49 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: Srinivas Kandagatla, linux-kernel

On Wed, Feb 14, 2024 at 04:04:57PM -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 nvmem_layout_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/nvmem/layouts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvmem/layouts.c b/drivers/nvmem/layouts.c
> index 6a6aa58369ff..8b5e2de138eb 100644
> --- a/drivers/nvmem/layouts.c
> +++ b/drivers/nvmem/layouts.c
> @@ -45,7 +45,7 @@ static void nvmem_layout_bus_remove(struct device *dev)
>  	return drv->remove(layout);
>  }
>  
> -static struct bus_type nvmem_layout_bus_type = {
> +static const struct bus_type nvmem_layout_bus_type = {
>  	.name		= "nvmem-layout",
>  	.match		= nvmem_layout_bus_match,
>  	.probe		= nvmem_layout_bus_probe,
> 
> ---
> base-commit: 2c8df24cc166478910c4e9e870adf44d157330fa
> change-id: 20240214-bus_cleanup-nvmem2-b77804172a0b
> 


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

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

* Re: [PATCH] nvmem: core: make nvmem_layout_bus_type const
  2024-02-14 19:04 [PATCH] nvmem: core: make nvmem_layout_bus_type const Ricardo B. Marliere
  2024-02-15  7:49 ` Greg Kroah-Hartman
@ 2024-02-21  7:10 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2024-02-21  7:10 UTC (permalink / raw)
  To: Ricardo B. Marliere; +Cc: linux-kernel, Greg Kroah-Hartman


On Wed, 14 Feb 2024 16:04:57 -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 nvmem_layout_bus_type variable to be a constant
> structure as well, placing it into read-only memory which can not be
> modified at runtime.
> 
> 
> [...]

Applied, thanks!

[1/1] nvmem: core: make nvmem_layout_bus_type const
      commit: 18e31aed2096896c76ce2867216180fce9cf7275

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


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

end of thread, other threads:[~2024-02-21  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-14 19:04 [PATCH] nvmem: core: make nvmem_layout_bus_type const Ricardo B. Marliere
2024-02-15  7:49 ` Greg Kroah-Hartman
2024-02-21  7:10 ` Srinivas Kandagatla

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.