* [PATCH] mips: bus: make mips_cdmm_bustype const
@ 2024-02-13 14:49 Ricardo B. Marliere
2024-02-13 17:27 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ricardo B. Marliere @ 2024-02-13 14:49 UTC (permalink / raw)
To: Thomas Bogendoerfer, Serge Semin
Cc: linux-mips, linux-kernel, Greg Kroah-Hartman, Ricardo B. Marliere
Now that the driver core can properly handle constant struct bus_type,
move the mips_cdmm_bustype 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/mips/include/asm/cdmm.h | 2 +-
drivers/bus/mips_cdmm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/cdmm.h b/arch/mips/include/asm/cdmm.h
index c06dbf8ba937..81fa99084178 100644
--- a/arch/mips/include/asm/cdmm.h
+++ b/arch/mips/include/asm/cdmm.h
@@ -63,7 +63,7 @@ struct mips_cdmm_driver {
*/
phys_addr_t mips_cdmm_phys_base(void);
-extern struct bus_type mips_cdmm_bustype;
+extern const struct bus_type mips_cdmm_bustype;
void __iomem *mips_cdmm_early_probe(unsigned int dev_type);
#define to_mips_cdmm_device(d) container_of(d, struct mips_cdmm_device, dev)
diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c
index 554e1992edd4..8baf14bd5eff 100644
--- a/drivers/bus/mips_cdmm.c
+++ b/drivers/bus/mips_cdmm.c
@@ -118,7 +118,7 @@ static struct attribute *mips_cdmm_dev_attrs[] = {
};
ATTRIBUTE_GROUPS(mips_cdmm_dev);
-struct bus_type mips_cdmm_bustype = {
+const struct bus_type mips_cdmm_bustype = {
.name = "cdmm",
.dev_groups = mips_cdmm_dev_groups,
.match = mips_cdmm_match,
---
base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
change-id: 20240213-bus_cleanup-mips2-434cc6d8f7bd
Best regards,
--
Ricardo B. Marliere <ricardo@marliere.net>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mips: bus: make mips_cdmm_bustype const
2024-02-13 14:49 [PATCH] mips: bus: make mips_cdmm_bustype const Ricardo B. Marliere
@ 2024-02-13 17:27 ` Greg Kroah-Hartman
2024-02-15 13:24 ` Serge Semin
2024-02-20 13:40 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2024-02-13 17:27 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Thomas Bogendoerfer, Serge Semin, linux-mips, linux-kernel
On Tue, Feb 13, 2024 at 11:49:24AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the mips_cdmm_bustype 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] 4+ messages in thread
* Re: [PATCH] mips: bus: make mips_cdmm_bustype const
2024-02-13 14:49 [PATCH] mips: bus: make mips_cdmm_bustype const Ricardo B. Marliere
2024-02-13 17:27 ` Greg Kroah-Hartman
@ 2024-02-15 13:24 ` Serge Semin
2024-02-20 13:40 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Serge Semin @ 2024-02-15 13:24 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Thomas Bogendoerfer, linux-mips, linux-kernel, Greg Kroah-Hartman
Hi Ricardo
On Tue, Feb 13, 2024 at 11:49:24AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the mips_cdmm_bustype variable to be a constant structure as well,
> placing it into read-only memory which can not be modified at runtime.
Thanks for the patch.
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
-Serge(y)
>
> 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/mips/include/asm/cdmm.h | 2 +-
> drivers/bus/mips_cdmm.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/include/asm/cdmm.h b/arch/mips/include/asm/cdmm.h
> index c06dbf8ba937..81fa99084178 100644
> --- a/arch/mips/include/asm/cdmm.h
> +++ b/arch/mips/include/asm/cdmm.h
> @@ -63,7 +63,7 @@ struct mips_cdmm_driver {
> */
> phys_addr_t mips_cdmm_phys_base(void);
>
> -extern struct bus_type mips_cdmm_bustype;
> +extern const struct bus_type mips_cdmm_bustype;
> void __iomem *mips_cdmm_early_probe(unsigned int dev_type);
>
> #define to_mips_cdmm_device(d) container_of(d, struct mips_cdmm_device, dev)
> diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c
> index 554e1992edd4..8baf14bd5eff 100644
> --- a/drivers/bus/mips_cdmm.c
> +++ b/drivers/bus/mips_cdmm.c
> @@ -118,7 +118,7 @@ static struct attribute *mips_cdmm_dev_attrs[] = {
> };
> ATTRIBUTE_GROUPS(mips_cdmm_dev);
>
> -struct bus_type mips_cdmm_bustype = {
> +const struct bus_type mips_cdmm_bustype = {
> .name = "cdmm",
> .dev_groups = mips_cdmm_dev_groups,
> .match = mips_cdmm_match,
>
> ---
> base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
> change-id: 20240213-bus_cleanup-mips2-434cc6d8f7bd
>
> Best regards,
> --
> Ricardo B. Marliere <ricardo@marliere.net>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mips: bus: make mips_cdmm_bustype const
2024-02-13 14:49 [PATCH] mips: bus: make mips_cdmm_bustype const Ricardo B. Marliere
2024-02-13 17:27 ` Greg Kroah-Hartman
2024-02-15 13:24 ` Serge Semin
@ 2024-02-20 13:40 ` Thomas Bogendoerfer
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2024-02-20 13:40 UTC (permalink / raw)
To: Ricardo B. Marliere
Cc: Serge Semin, linux-mips, linux-kernel, Greg Kroah-Hartman
On Tue, Feb 13, 2024 at 11:49:24AM -0300, Ricardo B. Marliere wrote:
> Now that the driver core can properly handle constant struct bus_type,
> move the mips_cdmm_bustype 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/mips/include/asm/cdmm.h | 2 +-
> drivers/bus/mips_cdmm.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-20 13:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 14:49 [PATCH] mips: bus: make mips_cdmm_bustype const Ricardo B. Marliere
2024-02-13 17:27 ` Greg Kroah-Hartman
2024-02-15 13:24 ` Serge Semin
2024-02-20 13:40 ` Thomas Bogendoerfer
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).