linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] ARM: use const and __initconst for smp_operations
@ 2015-08-24  4:36 Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops() Masahiro Yamada
                   ` (18 more replies)
  0 siblings, 19 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel


Currently, SoC code can not add const qualifier to smp_operations
structures although they are never over-written.

01/18 and 02/18 add small changes to the ARM core to fix that.
The rest of this series replace "__initdata" with "const ... __initconst"
for each of SoC code.

I split this series into per-SoC so that each sub-arch maintainer
can easily give their Acked-by.  (Is this better?)

Russell, Olof, and Arnd:

How should this series be applied (if it looks good)?
The first two are ARM-tree wide and looks like in the field of Russell.
The rest are highly SoC-related.



Masahiro Yamada (18):
  ARM: add const qualifier to the argument of smp_set_ops()
  ARM: add const qualifier to smp_operations member in structures
  ARM: alpine: use const and __initconst for smp_operations
  ARM: axxia: use const and __initconst for smp_operations
  ARM: BCM: use const and __initconst for smp_operations
  ARM: berlin: use const and __initconst for smp_operations
  ARM: EXYNOS: use const and __initconst for smp_operations
  ARM: hisi: do not export smp_operations structures
  ARM: hisi: use const and __initconst for smp_operations
  ARM: mvebu: use const and __initconst for smp_operations
  ARM: qcom: use const and __initconst for smp_operations
  ARM: rockchip: use const and __initconst for smp_operations
  ARM: socfpga: use const and __initconst for smp_operations
  ARM: sunxi: use const and __initconst for smp_operations
  ARM: uniphier: use const and __initconst for smp_operations
  ARM: zx: use const and __initconst for smp_operations
  ARM: zynq: use const and __initconst for smp_operations
  ARM: mcpm: use const and __initconst for smp_operations

 arch/arm/common/mcpm_platsmp.c      | 2 +-
 arch/arm/include/asm/mach/arch.h    | 2 +-
 arch/arm/include/asm/smp.h          | 4 ++--
 arch/arm/kernel/smp.c               | 2 +-
 arch/arm/mach-alpine/platsmp.c      | 2 +-
 arch/arm/mach-axxia/platsmp.c       | 2 +-
 arch/arm/mach-bcm/bcm63xx_smp.c     | 2 +-
 arch/arm/mach-bcm/kona_smp.c        | 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 arch/arm/mach-berlin/platsmp.c      | 2 +-
 arch/arm/mach-exynos/common.h       | 2 +-
 arch/arm/mach-exynos/platsmp.c      | 2 +-
 arch/arm/mach-hisi/core.h           | 3 ---
 arch/arm/mach-hisi/platsmp.c        | 6 +++---
 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c    | 4 ++--
 arch/arm/mach-mvebu/platsmp.c       | 2 +-
 arch/arm/mach-qcom/platsmp.c        | 6 +++---
 arch/arm/mach-rockchip/platsmp.c    | 2 +-
 arch/arm/mach-socfpga/platsmp.c     | 4 ++--
 arch/arm/mach-sunxi/platsmp.c       | 4 ++--
 arch/arm/mach-uniphier/platsmp.c    | 2 +-
 arch/arm/mach-zx/platsmp.c          | 2 +-
 arch/arm/mach-zynq/common.h         | 2 +-
 arch/arm/mach-zynq/platsmp.c        | 2 +-
 25 files changed, 32 insertions(+), 35 deletions(-)

-- 
1.9.1

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

* [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24 20:33   ` Stephen Boyd
  2015-08-24  4:36 ` [PATCH 02/18] ARM: add const qualifier to smp_operations member in structures Masahiro Yamada
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

This function just copies '*ops' to 'smp_ops', so the given
structure '*ops' is not modified at all.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/include/asm/smp.h | 2 +-
 arch/arm/kernel/smp.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 2f3ac1b..cd81540 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -122,6 +122,6 @@ struct of_cpu_method {
 /*
  * set platform specific SMP operations
  */
-extern void smp_set_ops(struct smp_operations *);
+extern void smp_set_ops(const struct smp_operations *);
 
 #endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 3d6b782..bb63a4e 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -78,7 +78,7 @@ static DECLARE_COMPLETION(cpu_running);
 
 static struct smp_operations smp_ops;
 
-void __init smp_set_ops(struct smp_operations *ops)
+void __init smp_set_ops(const struct smp_operations *ops)
 {
 	if (ops)
 		smp_ops = *ops;
-- 
1.9.1

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

* [PATCH 02/18] ARM: add const qualifier to smp_operations member in structures
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops() Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations Masahiro Yamada
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The core framework does not modify smp_operations structures.
To clarify it, this commit adds 'const' qualifier to the 'ops'
member of struct of_cpu_method and the 'smp' member of struct
machine_desc.

This change allows each SoC code to add 'const' qualifier to its
smp_operation structure.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/include/asm/mach/arch.h | 2 +-
 arch/arm/include/asm/smp.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index cb3a407..5c1ad11 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -47,7 +47,7 @@ struct machine_desc {
 	unsigned		l2c_aux_val;	/* L2 cache aux value	*/
 	unsigned		l2c_aux_mask;	/* L2 cache aux mask	*/
 	void			(*l2c_write_sec)(unsigned long, unsigned);
-	struct smp_operations	*smp;		/* SMP operations	*/
+	const struct smp_operations	*smp;	/* SMP operations	*/
 	bool			(*smp_init)(void);
 	void			(*fixup)(struct tag *, char **);
 	void			(*dt_fixup)(void);
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index cd81540..50aff58 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -112,7 +112,7 @@ struct smp_operations {
 
 struct of_cpu_method {
 	const char *method;
-	struct smp_operations *ops;
+	const struct smp_operations *ops;
 };
 
 #define CPU_METHOD_OF_DECLARE(name, _method, _ops)			\
-- 
1.9.1

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

* [PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops() Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 02/18] ARM: add const qualifier to smp_operations member in structures Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 04/18] ARM: axxia: " Masahiro Yamada
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-alpine/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-alpine/platsmp.c b/arch/arm/mach-alpine/platsmp.c
index f78429f..dd77ea2 100644
--- a/arch/arm/mach-alpine/platsmp.c
+++ b/arch/arm/mach-alpine/platsmp.c
@@ -42,7 +42,7 @@ static void __init alpine_smp_prepare_cpus(unsigned int max_cpus)
 	alpine_cpu_pm_init();
 }
 
-static struct smp_operations alpine_smp_ops __initdata = {
+static const struct smp_operations alpine_smp_ops __initconst = {
 	.smp_prepare_cpus	= alpine_smp_prepare_cpus,
 	.smp_boot_secondary	= alpine_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 04/18] ARM: axxia: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (2 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 05/18] ARM: BCM: " Masahiro Yamada
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-axxia/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index 959d4df..ffbd71d 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -82,7 +82,7 @@ static void __init axxia_smp_prepare_cpus(unsigned int max_cpus)
 	}
 }
 
-static struct smp_operations axxia_smp_ops __initdata = {
+static const struct smp_operations axxia_smp_ops __initconst = {
 	.smp_prepare_cpus	= axxia_smp_prepare_cpus,
 	.smp_boot_secondary	= axxia_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (3 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 04/18] ARM: axxia: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24 18:33   ` Florian Fainelli
  2015-08-24  4:36 ` [PATCH 06/18] ARM: berlin: " Masahiro Yamada
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to bcm63138_smp_ops.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-bcm/bcm63xx_smp.c     | 2 +-
 arch/arm/mach-bcm/kona_smp.c        | 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
index 19be904..9b6727e 100644
--- a/arch/arm/mach-bcm/bcm63xx_smp.c
+++ b/arch/arm/mach-bcm/bcm63xx_smp.c
@@ -161,7 +161,7 @@ static void __init bcm63138_smp_prepare_cpus(unsigned int max_cpus)
 	}
 }
 
-struct smp_operations bcm63138_smp_ops __initdata = {
+static const struct smp_operations bcm63138_smp_ops __initconst = {
 	.smp_prepare_cpus	= bcm63138_smp_prepare_cpus,
 	.smp_boot_secondary	= bcm63138_smp_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/kona_smp.c b/arch/arm/mach-bcm/kona_smp.c
index 66a0465..da8328b 100644
--- a/arch/arm/mach-bcm/kona_smp.c
+++ b/arch/arm/mach-bcm/kona_smp.c
@@ -194,7 +194,7 @@ static int bcm_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return -ENOSYS;
 }
 
-static struct smp_operations bcm_smp_ops __initdata = {
+static const struct smp_operations bcm_smp_ops __initconst = {
 	.smp_prepare_cpus	= bcm_smp_prepare_cpus,
 	.smp_boot_secondary	= bcm_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c b/arch/arm/mach-bcm/platsmp-brcmstb.c
index 44d6bddf..40dc844 100644
--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
+++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
@@ -356,7 +356,7 @@ static int brcmstb_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return 0;
 }
 
-static struct smp_operations brcmstb_smp_ops __initdata = {
+static const struct smp_operations brcmstb_smp_ops __initconst = {
 	.smp_prepare_cpus	= brcmstb_cpu_ctrl_setup,
 	.smp_boot_secondary	= brcmstb_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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

* [PATCH 06/18] ARM: berlin: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (4 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 05/18] ARM: BCM: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 07/18] ARM: EXYNOS: " Masahiro Yamada
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-berlin/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
index 34a3753..41a626b 100644
--- a/arch/arm/mach-berlin/platsmp.c
+++ b/arch/arm/mach-berlin/platsmp.c
@@ -91,7 +91,7 @@ unmap_scu:
 	iounmap(scu_base);
 }
 
-static struct smp_operations berlin_smp_ops __initdata = {
+static const struct smp_operations berlin_smp_ops __initconst = {
 	.smp_prepare_cpus	= berlin_smp_prepare_cpus,
 	.smp_boot_secondary	= berlin_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (5 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 06/18] ARM: berlin: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  7:17   ` Krzysztof Kozlowski
  2015-08-24  4:36 ` [PATCH 08/18] ARM: hisi: do not export smp_operations structures Masahiro Yamada
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-exynos/common.h  | 2 +-
 arch/arm/mach-exynos/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 1534925..e349a03 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -149,7 +149,7 @@ static inline void exynos_pm_init(void) {}
 extern void exynos_cpu_resume(void);
 extern void exynos_cpu_resume_ns(void);
 
-extern struct smp_operations exynos_smp_ops;
+extern const struct smp_operations exynos_smp_ops;
 
 extern void exynos_cpu_power_down(int cpu);
 extern void exynos_cpu_power_up(int cpu);
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 98a2c0c..5bd9559 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -479,7 +479,7 @@ static void exynos_cpu_die(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-struct smp_operations exynos_smp_ops __initdata = {
+const struct smp_operations exynos_smp_ops __initconst = {
 	.smp_init_cpus		= exynos_smp_init_cpus,
 	.smp_prepare_cpus	= exynos_smp_prepare_cpus,
 	.smp_secondary_init	= exynos_secondary_init,
-- 
1.9.1

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

* [PATCH 08/18] ARM: hisi: do not export smp_operations structures
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (6 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 07/18] ARM: EXYNOS: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations Masahiro Yamada
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

These three structures are only defined and referenced in
mach-hisi/platsmp.c.

Drop the declarations from the header and add static qualifier
to the definitions.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-hisi/core.h    | 3 ---
 arch/arm/mach-hisi/platsmp.c | 6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-hisi/core.h b/arch/arm/mach-hisi/core.h
index c7648ef..e883583 100644
--- a/arch/arm/mach-hisi/core.h
+++ b/arch/arm/mach-hisi/core.h
@@ -6,17 +6,14 @@
 extern void hi3xxx_set_cpu_jump(int cpu, void *jump_addr);
 extern int hi3xxx_get_cpu_jump(int cpu);
 extern void secondary_startup(void);
-extern struct smp_operations hi3xxx_smp_ops;
 
 extern void hi3xxx_cpu_die(unsigned int cpu);
 extern int hi3xxx_cpu_kill(unsigned int cpu);
 extern void hi3xxx_set_cpu(int cpu, bool enable);
 
-extern struct smp_operations hix5hd2_smp_ops;
 extern void hix5hd2_set_cpu(int cpu, bool enable);
 extern void hix5hd2_cpu_die(unsigned int cpu);
 
-extern struct smp_operations hip01_smp_ops;
 extern void hip01_set_cpu(int cpu, bool enable);
 extern void hip01_cpu_die(unsigned int cpu);
 #endif
diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 5174412..3c5237d 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return 0;
 }
 
-struct smp_operations hi3xxx_smp_ops __initdata = {
+static struct smp_operations hi3xxx_smp_ops __initdata = {
 	.smp_prepare_cpus	= hi3xxx_smp_prepare_cpus,
 	.smp_boot_secondary	= hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct task_struct *idle)
 }
 
 
-struct smp_operations hix5hd2_smp_ops __initdata = {
+static struct smp_operations hix5hd2_smp_ops __initdata = {
 	.smp_prepare_cpus	= hisi_common_smp_prepare_cpus,
 	.smp_boot_secondary	= hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return 0;
 }
 
-struct smp_operations hip01_smp_ops __initdata = {
+static struct smp_operations hip01_smp_ops __initdata = {
 	.smp_prepare_cpus       = hisi_common_smp_prepare_cpus,
 	.smp_boot_secondary     = hip01_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (7 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 08/18] ARM: hisi: do not export smp_operations structures Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 10/18] ARM: mvebu: " Masahiro Yamada
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-hisi/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 3c5237d..47ed32c 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return 0;
 }
 
-static struct smp_operations hi3xxx_smp_ops __initdata = {
+static const struct smp_operations hi3xxx_smp_ops __initconst = {
 	.smp_prepare_cpus	= hi3xxx_smp_prepare_cpus,
 	.smp_boot_secondary	= hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct task_struct *idle)
 }
 
 
-static struct smp_operations hix5hd2_smp_ops __initdata = {
+static const struct smp_operations hix5hd2_smp_ops __initconst = {
 	.smp_prepare_cpus	= hisi_common_smp_prepare_cpus,
 	.smp_boot_secondary	= hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct task_struct *idle)
 	return 0;
 }
 
-static struct smp_operations hip01_smp_ops __initdata = {
+static const struct smp_operations hip01_smp_ops __initconst = {
 	.smp_prepare_cpus       = hisi_common_smp_prepare_cpus,
 	.smp_boot_secondary     = hip01_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 10/18] ARM: mvebu: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (8 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 11/18] ARM: qcom: " Masahiro Yamada
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c    | 4 ++--
 arch/arm/mach-mvebu/platsmp.c       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.h b/arch/arm/mach-mvebu/armada-370-xp.h
index c55bbf8..09413b6 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.h
+++ b/arch/arm/mach-mvebu/armada-370-xp.h
@@ -17,7 +17,7 @@
 
 #ifdef CONFIG_SMP
 void armada_xp_secondary_startup(void);
-extern struct smp_operations armada_xp_smp_ops;
+extern const struct smp_operations armada_xp_smp_ops;
 #endif
 
 #endif /* __MACH_ARMADA_370_XP_H */
diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c
index 3d50004..d715dec 100644
--- a/arch/arm/mach-mvebu/platsmp-a9.c
+++ b/arch/arm/mach-mvebu/platsmp-a9.c
@@ -93,11 +93,11 @@ static int armada_38x_cpu_kill(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
+static const struct smp_operations mvebu_cortex_a9_smp_ops __initconst = {
 	.smp_boot_secondary	= mvebu_cortex_a9_boot_secondary,
 };
 
-static struct smp_operations armada_38x_smp_ops __initdata = {
+static const struct smp_operations armada_38x_smp_ops __initconst = {
 	.smp_boot_secondary	= mvebu_cortex_a9_boot_secondary,
 	.smp_secondary_init     = armada_38x_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index 58cc8c1..f9597b7 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -170,7 +170,7 @@ static int armada_xp_cpu_kill(unsigned int cpu)
 }
 #endif
 
-struct smp_operations armada_xp_smp_ops __initdata = {
+const struct smp_operations armada_xp_smp_ops __initconst = {
 	.smp_init_cpus		= armada_xp_smp_init_cpus,
 	.smp_prepare_cpus	= armada_xp_smp_prepare_cpus,
 	.smp_boot_secondary	= armada_xp_boot_secondary,
-- 
1.9.1

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

* [PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (9 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 10/18] ARM: mvebu: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24 19:36   ` Andy Gross
  2015-08-24  4:36 ` [PATCH 12/18] ARM: rockchip: " Masahiro Yamada
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-qcom/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c
index 5cde63a..11847cd 100644
--- a/arch/arm/mach-qcom/platsmp.c
+++ b/arch/arm/mach-qcom/platsmp.c
@@ -332,7 +332,7 @@ static void __init qcom_smp_prepare_cpus(unsigned int max_cpus)
 	}
 }
 
-static struct smp_operations smp_msm8660_ops __initdata = {
+static const struct smp_operations smp_msm8660_ops __initconst = {
 	.smp_prepare_cpus	= qcom_smp_prepare_cpus,
 	.smp_secondary_init	= qcom_secondary_init,
 	.smp_boot_secondary	= msm8660_boot_secondary,
@@ -342,7 +342,7 @@ static struct smp_operations smp_msm8660_ops __initdata = {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp, "qcom,gcc-msm8660", &smp_msm8660_ops);
 
-static struct smp_operations qcom_smp_kpssv1_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv1_ops __initconst = {
 	.smp_prepare_cpus	= qcom_smp_prepare_cpus,
 	.smp_secondary_init	= qcom_secondary_init,
 	.smp_boot_secondary	= kpssv1_boot_secondary,
@@ -352,7 +352,7 @@ static struct smp_operations qcom_smp_kpssv1_ops __initdata = {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp_kpssv1, "qcom,kpss-acc-v1", &qcom_smp_kpssv1_ops);
 
-static struct smp_operations qcom_smp_kpssv2_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv2_ops __initconst = {
 	.smp_prepare_cpus	= qcom_smp_prepare_cpus,
 	.smp_secondary_init	= qcom_secondary_init,
 	.smp_boot_secondary	= kpssv2_boot_secondary,
-- 
1.9.1

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

* [PATCH 12/18] ARM: rockchip: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (10 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 11/18] ARM: qcom: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 13/18] ARM: socfpga: " Masahiro Yamada
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-rockchip/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 3e7a4b7..938888f 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -340,7 +340,7 @@ static void rockchip_cpu_die(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations rockchip_smp_ops __initdata = {
+static const struct smp_operations rockchip_smp_ops __initconst = {
 	.smp_prepare_cpus	= rockchip_smp_prepare_cpus,
 	.smp_boot_secondary	= rockchip_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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

* [PATCH 13/18] ARM: socfpga: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (11 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 12/18] ARM: rockchip: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 14/18] ARM: sunxi: " Masahiro Yamada
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-socfpga/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 15c8ce8..cbb0a54 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -117,7 +117,7 @@ static int socfpga_cpu_kill(unsigned int cpu)
 	return 1;
 }
 
-static struct smp_operations socfpga_smp_ops __initdata = {
+static const struct smp_operations socfpga_smp_ops __initconst = {
 	.smp_prepare_cpus	= socfpga_smp_prepare_cpus,
 	.smp_boot_secondary	= socfpga_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static struct smp_operations socfpga_smp_ops __initdata = {
 #endif
 };
 
-static struct smp_operations socfpga_a10_smp_ops __initdata = {
+static const struct smp_operations socfpga_a10_smp_ops __initconst = {
 	.smp_prepare_cpus	= socfpga_smp_prepare_cpus,
 	.smp_boot_secondary	= socfpga_a10_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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

* [PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (12 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 13/18] ARM: socfpga: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  6:22   ` Maxime Ripard
  2015-08-24  4:36 ` [PATCH 15/18] ARM: uniphier: " Masahiro Yamada
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to sun8i_smp_ops.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-sunxi/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index e8483ec..6642267 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -116,7 +116,7 @@ static int sun6i_smp_boot_secondary(unsigned int cpu,
 	return 0;
 }
 
-static struct smp_operations sun6i_smp_ops __initdata = {
+static const struct smp_operations sun6i_smp_ops __initconst = {
 	.smp_prepare_cpus	= sun6i_smp_prepare_cpus,
 	.smp_boot_secondary	= sun6i_smp_boot_secondary,
 };
@@ -185,7 +185,7 @@ static int sun8i_smp_boot_secondary(unsigned int cpu,
 	return 0;
 }
 
-struct smp_operations sun8i_smp_ops __initdata = {
+static const struct smp_operations sun8i_smp_ops __initconst = {
 	.smp_prepare_cpus	= sun8i_smp_prepare_cpus,
 	.smp_boot_secondary	= sun8i_smp_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 15/18] ARM: uniphier: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (13 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 14/18] ARM: sunxi: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 16/18] ARM: zx: " Masahiro Yamada
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 4b784f7..da5359c 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -76,7 +76,7 @@ static int uniphier_boot_secondary(unsigned int cpu,
 	return ret;
 }
 
-struct smp_operations uniphier_smp_ops __initdata = {
+static const struct smp_operations uniphier_smp_ops __initconst = {
 	.smp_prepare_cpus	= uniphier_smp_prepare_cpus,
 	.smp_boot_secondary	= uniphier_boot_secondary,
 };
-- 
1.9.1

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

* [PATCH 16/18] ARM: zx: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (14 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 15/18] ARM: uniphier: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24  4:36 ` [PATCH 17/18] ARM: zynq: " Masahiro Yamada
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to the structure.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-zx/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zx/platsmp.c b/arch/arm/mach-zx/platsmp.c
index a369398..0297f92 100644
--- a/arch/arm/mach-zx/platsmp.c
+++ b/arch/arm/mach-zx/platsmp.c
@@ -176,7 +176,7 @@ static void zx_secondary_init(unsigned int cpu)
 	scu_power_mode(scu_base, SCU_PM_NORMAL);
 }
 
-struct smp_operations zx_smp_ops __initdata = {
+static const struct smp_operations zx_smp_ops __initconst = {
 	.smp_prepare_cpus	= zx_smp_prepare_cpus,
 	.smp_secondary_init	= zx_secondary_init,
 	.smp_boot_secondary	= zx_boot_secondary,
-- 
1.9.1

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

* [PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (15 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 16/18] ARM: zx: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24 19:58   ` Moritz Fischer
  2015-08-24  4:36 ` [PATCH 18/18] ARM: mcpm: " Masahiro Yamada
  2015-08-24 21:12 ` [PATCH 00/18] ARM: " Olof Johansson
  18 siblings, 1 reply; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-zynq/common.h  | 2 +-
 arch/arm/mach-zynq/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index 79cda2e..e771933 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -30,7 +30,7 @@ extern char zynq_secondary_trampoline;
 extern char zynq_secondary_trampoline_jump;
 extern char zynq_secondary_trampoline_end;
 extern int zynq_cpun_start(u32 address, int cpu);
-extern struct smp_operations zynq_smp_ops __initdata;
+extern const struct smp_operations zynq_smp_ops;
 #endif
 
 extern void __iomem *zynq_scu_base;
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index f66816c..7cd9865 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -157,7 +157,7 @@ static void zynq_cpu_die(unsigned int cpu)
 }
 #endif
 
-struct smp_operations zynq_smp_ops __initdata = {
+const struct smp_operations zynq_smp_ops __initconst = {
 	.smp_init_cpus		= zynq_smp_init_cpus,
 	.smp_prepare_cpus	= zynq_smp_prepare_cpus,
 	.smp_boot_secondary	= zynq_boot_secondary,
-- 
1.9.1

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

* [PATCH 18/18] ARM: mcpm: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (16 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 17/18] ARM: zynq: " Masahiro Yamada
@ 2015-08-24  4:36 ` Masahiro Yamada
  2015-08-24 21:12 ` [PATCH 00/18] ARM: " Olof Johansson
  18 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-24  4:36 UTC (permalink / raw)
  To: linux-arm-kernel

The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, __initconst has been moved after mcpm_smp_ops because
scripts/checkpatch.pl suggests to do so.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/common/mcpm_platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/common/mcpm_platsmp.c b/arch/arm/common/mcpm_platsmp.c
index 92e54d7..1011b0e 100644
--- a/arch/arm/common/mcpm_platsmp.c
+++ b/arch/arm/common/mcpm_platsmp.c
@@ -87,7 +87,7 @@ static void mcpm_cpu_die(unsigned int cpu)
 
 #endif
 
-static struct smp_operations __initdata mcpm_smp_ops = {
+static const struct smp_operations mcpm_smp_ops __initconst = {
 	.smp_boot_secondary	= mcpm_boot_secondary,
 	.smp_secondary_init	= mcpm_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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

* [PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations
  2015-08-24  4:36 ` [PATCH 14/18] ARM: sunxi: " Masahiro Yamada
@ 2015-08-24  6:22   ` Maxime Ripard
  0 siblings, 0 replies; 30+ messages in thread
From: Maxime Ripard @ 2015-08-24  6:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 24, 2015 at 01:36:14PM +0900, Masahiro Yamada wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
> 
> Also, add static to sun8i_smp_ops.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150824/9e349cd7/attachment.sig>

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

* [PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations
  2015-08-24  4:36 ` [PATCH 07/18] ARM: EXYNOS: " Masahiro Yamada
@ 2015-08-24  7:17   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2015-08-24  7:17 UTC (permalink / raw)
  To: linux-arm-kernel

On 24.08.2015 13:36, Masahiro Yamada wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  arch/arm/mach-exynos/common.h  | 2 +-
>  arch/arm/mach-exynos/platsmp.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

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

* [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations
  2015-08-24  4:36 ` [PATCH 05/18] ARM: BCM: " Masahiro Yamada
@ 2015-08-24 18:33   ` Florian Fainelli
  2015-08-24 20:24     ` Ray Jui
  0 siblings, 1 reply; 30+ messages in thread
From: Florian Fainelli @ 2015-08-24 18:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 23/08/15 21:36, Masahiro Yamada wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
> 
> Also, add static to bcm63138_smp_ops.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

For bcm63xx and brcmstb:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
> 
>  arch/arm/mach-bcm/bcm63xx_smp.c     | 2 +-
>  arch/arm/mach-bcm/kona_smp.c        | 2 +-
>  arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
> index 19be904..9b6727e 100644
> --- a/arch/arm/mach-bcm/bcm63xx_smp.c
> +++ b/arch/arm/mach-bcm/bcm63xx_smp.c
> @@ -161,7 +161,7 @@ static void __init bcm63138_smp_prepare_cpus(unsigned int max_cpus)
>  	}
>  }
>  
> -struct smp_operations bcm63138_smp_ops __initdata = {
> +static const struct smp_operations bcm63138_smp_ops __initconst = {
>  	.smp_prepare_cpus	= bcm63138_smp_prepare_cpus,
>  	.smp_boot_secondary	= bcm63138_smp_boot_secondary,
>  };
> diff --git a/arch/arm/mach-bcm/kona_smp.c b/arch/arm/mach-bcm/kona_smp.c
> index 66a0465..da8328b 100644
> --- a/arch/arm/mach-bcm/kona_smp.c
> +++ b/arch/arm/mach-bcm/kona_smp.c
> @@ -194,7 +194,7 @@ static int bcm_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  	return -ENOSYS;
>  }
>  
> -static struct smp_operations bcm_smp_ops __initdata = {
> +static const struct smp_operations bcm_smp_ops __initconst = {
>  	.smp_prepare_cpus	= bcm_smp_prepare_cpus,
>  	.smp_boot_secondary	= bcm_boot_secondary,
>  };
> diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c b/arch/arm/mach-bcm/platsmp-brcmstb.c
> index 44d6bddf..40dc844 100644
> --- a/arch/arm/mach-bcm/platsmp-brcmstb.c
> +++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
> @@ -356,7 +356,7 @@ static int brcmstb_boot_secondary(unsigned int cpu, struct task_struct *idle)
>  	return 0;
>  }
>  
> -static struct smp_operations brcmstb_smp_ops __initdata = {
> +static const struct smp_operations brcmstb_smp_ops __initconst = {
>  	.smp_prepare_cpus	= brcmstb_cpu_ctrl_setup,
>  	.smp_boot_secondary	= brcmstb_boot_secondary,
>  #ifdef CONFIG_HOTPLUG_CPU
> 


-- 
Florian

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

* [PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations
  2015-08-24  4:36 ` [PATCH 11/18] ARM: qcom: " Masahiro Yamada
@ 2015-08-24 19:36   ` Andy Gross
  0 siblings, 0 replies; 30+ messages in thread
From: Andy Gross @ 2015-08-24 19:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 24, 2015 at 01:36:11PM +0900, Masahiro Yamada wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Thanks!

Reviewed-by: Andy Gross <agross@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations
  2015-08-24  4:36 ` [PATCH 17/18] ARM: zynq: " Masahiro Yamada
@ 2015-08-24 19:58   ` Moritz Fischer
  0 siblings, 0 replies; 30+ messages in thread
From: Moritz Fischer @ 2015-08-24 19:58 UTC (permalink / raw)
  To: linux-arm-kernel

Acked-by: Moritz Fischer <moritz.fischer@ettus.com>

Thanks,

Moritz

On Mon, Aug 24, 2015 at 12:36 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  arch/arm/mach-zynq/common.h  | 2 +-
>  arch/arm/mach-zynq/platsmp.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
> index 79cda2e..e771933 100644
> --- a/arch/arm/mach-zynq/common.h
> +++ b/arch/arm/mach-zynq/common.h
> @@ -30,7 +30,7 @@ extern char zynq_secondary_trampoline;
>  extern char zynq_secondary_trampoline_jump;
>  extern char zynq_secondary_trampoline_end;
>  extern int zynq_cpun_start(u32 address, int cpu);
> -extern struct smp_operations zynq_smp_ops __initdata;
> +extern const struct smp_operations zynq_smp_ops;
>  #endif
>
>  extern void __iomem *zynq_scu_base;
> diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
> index f66816c..7cd9865 100644
> --- a/arch/arm/mach-zynq/platsmp.c
> +++ b/arch/arm/mach-zynq/platsmp.c
> @@ -157,7 +157,7 @@ static void zynq_cpu_die(unsigned int cpu)
>  }
>  #endif
>
> -struct smp_operations zynq_smp_ops __initdata = {
> +const struct smp_operations zynq_smp_ops __initconst = {
>         .smp_init_cpus          = zynq_smp_init_cpus,
>         .smp_prepare_cpus       = zynq_smp_prepare_cpus,
>         .smp_boot_secondary     = zynq_boot_secondary,
> --
> 1.9.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations
  2015-08-24 18:33   ` Florian Fainelli
@ 2015-08-24 20:24     ` Ray Jui
  0 siblings, 0 replies; 30+ messages in thread
From: Ray Jui @ 2015-08-24 20:24 UTC (permalink / raw)
  To: linux-arm-kernel



On 8/24/2015 11:33 AM, Florian Fainelli wrote:
> On 23/08/15 21:36, Masahiro Yamada wrote:
>> The smp_operations structure is not over-written, so add const
>> qualifier and replace __initdata with __initconst.
>>
>> Also, add static to bcm63138_smp_ops.
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> 
> For bcm63xx and brcmstb:
> 
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> 
>> ---
>>
>>  arch/arm/mach-bcm/bcm63xx_smp.c     | 2 +-
>>  arch/arm/mach-bcm/kona_smp.c        | 2 +-
>>  arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
>> index 19be904..9b6727e 100644
>> --- a/arch/arm/mach-bcm/bcm63xx_smp.c
>> +++ b/arch/arm/mach-bcm/bcm63xx_smp.c
>> @@ -161,7 +161,7 @@ static void __init bcm63138_smp_prepare_cpus(unsigned int max_cpus)
>>  	}
>>  }
>>  
>> -struct smp_operations bcm63138_smp_ops __initdata = {
>> +static const struct smp_operations bcm63138_smp_ops __initconst = {
>>  	.smp_prepare_cpus	= bcm63138_smp_prepare_cpus,
>>  	.smp_boot_secondary	= bcm63138_smp_boot_secondary,
>>  };
>> diff --git a/arch/arm/mach-bcm/kona_smp.c b/arch/arm/mach-bcm/kona_smp.c
>> index 66a0465..da8328b 100644
>> --- a/arch/arm/mach-bcm/kona_smp.c
>> +++ b/arch/arm/mach-bcm/kona_smp.c
>> @@ -194,7 +194,7 @@ static int bcm_boot_secondary(unsigned int cpu, struct task_struct *idle)
>>  	return -ENOSYS;
>>  }
>>  
>> -static struct smp_operations bcm_smp_ops __initdata = {
>> +static const struct smp_operations bcm_smp_ops __initconst = {
>>  	.smp_prepare_cpus	= bcm_smp_prepare_cpus,
>>  	.smp_boot_secondary	= bcm_boot_secondary,
>>  };

The change to kona_smp.c looks fine to me.

Signed-off-by: Ray Jui <rjui@broadcom.com>

Thanks,

Ray

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

* [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()
  2015-08-24  4:36 ` [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops() Masahiro Yamada
@ 2015-08-24 20:33   ` Stephen Boyd
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen Boyd @ 2015-08-24 20:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 08/24, Masahiro Yamada wrote:
> This function just copies '*ops' to 'smp_ops', so the given
> structure '*ops' is not modified at all.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Acked-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* [PATCH 00/18] ARM: use const and __initconst for smp_operations
  2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
                   ` (17 preceding siblings ...)
  2015-08-24  4:36 ` [PATCH 18/18] ARM: mcpm: " Masahiro Yamada
@ 2015-08-24 21:12 ` Olof Johansson
  2015-08-24 21:21   ` Russell King - ARM Linux
  18 siblings, 1 reply; 30+ messages in thread
From: Olof Johansson @ 2015-08-24 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Aug 23, 2015 at 9:36 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Currently, SoC code can not add const qualifier to smp_operations
> structures although they are never over-written.
>
> 01/18 and 02/18 add small changes to the ARM core to fix that.
> The rest of this series replace "__initdata" with "const ... __initconst"
> for each of SoC code.
>
> I split this series into per-SoC so that each sub-arch maintainer
> can easily give their Acked-by.  (Is this better?)

When you split, chances are each sub-arch maintainer will apply
instead of ack. If that's what you want, that's fine.

> Russell, Olof, and Arnd:
>
> How should this series be applied (if it looks good)?
> The first two are ARM-tree wide and looks like in the field of Russell.
> The rest are highly SoC-related.

Easiest of all would probably be to get the sub-arch patches into one
release, then switch the prototypes and function definitions in the
next. If you switch prototypes first you'll get a bunch of warnings,
right?


-Olof

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

* [PATCH 00/18] ARM: use const and __initconst for smp_operations
  2015-08-24 21:12 ` [PATCH 00/18] ARM: " Olof Johansson
@ 2015-08-24 21:21   ` Russell King - ARM Linux
  2015-08-24 21:44     ` Olof Johansson
  0 siblings, 1 reply; 30+ messages in thread
From: Russell King - ARM Linux @ 2015-08-24 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 24, 2015 at 02:12:06PM -0700, Olof Johansson wrote:
> Easiest of all would probably be to get the sub-arch patches into one
> release, then switch the prototypes and function definitions in the
> next. If you switch prototypes first you'll get a bunch of warnings,
> right?

Wrong way around. :)

If you change the sub-arches to declare the smp operations as const,
and try and pass them into a function which doesn't take a const-pointer,
you'll get a warning.  The core bits need to go in first before the
sub-arch patches.

I think the series has limited value - it allows us to (a) check that a
small quantity of code doesn't write to these things, and (b) allows us
to move the SMP operations structure from __initdata to __initconstdata.
It's still going to end up in the init region which is read/write in any
case, and still gets thrown away.

Given where we are, I don't think we need to rush this in during the
last week before the merge window opens, even though it's trivial.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH 00/18] ARM: use const and __initconst for smp_operations
  2015-08-24 21:21   ` Russell King - ARM Linux
@ 2015-08-24 21:44     ` Olof Johansson
  2015-08-25  1:37       ` Masahiro Yamada
  0 siblings, 1 reply; 30+ messages in thread
From: Olof Johansson @ 2015-08-24 21:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 24, 2015 at 2:21 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Aug 24, 2015 at 02:12:06PM -0700, Olof Johansson wrote:
>> Easiest of all would probably be to get the sub-arch patches into one
>> release, then switch the prototypes and function definitions in the
>> next. If you switch prototypes first you'll get a bunch of warnings,
>> right?
>
> Wrong way around. :)
>
> If you change the sub-arches to declare the smp operations as const,
> and try and pass them into a function which doesn't take a const-pointer,
> you'll get a warning.  The core bits need to go in first before the
> sub-arch patches.

Ah yes, my bad.

> I think the series has limited value - it allows us to (a) check that a
> small quantity of code doesn't write to these things, and (b) allows us
> to move the SMP operations structure from __initdata to __initconstdata.
> It's still going to end up in the init region which is read/write in any
> case, and still gets thrown away.
>
> Given where we are, I don't think we need to rush this in during the
> last week before the merge window opens, even though it's trivial.

Agreed. So if you pick it up for 4.4, we'll get the rest for 4.5.


-Olof

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

* [PATCH 00/18] ARM: use const and __initconst for smp_operations
  2015-08-24 21:44     ` Olof Johansson
@ 2015-08-25  1:37       ` Masahiro Yamada
  0 siblings, 0 replies; 30+ messages in thread
From: Masahiro Yamada @ 2015-08-25  1:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Russell, Olof,

2015-08-25 6:44 GMT+09:00 Olof Johansson <olof@lixom.net>:
> On Mon, Aug 24, 2015 at 2:21 PM, Russell King - ARM Linux
> <linux@arm.linux.org.uk> wrote:
>> On Mon, Aug 24, 2015 at 02:12:06PM -0700, Olof Johansson wrote:
>>> Easiest of all would probably be to get the sub-arch patches into one
>>> release, then switch the prototypes and function definitions in the
>>> next. If you switch prototypes first you'll get a bunch of warnings,
>>> right?
>>
>> Wrong way around. :)
>>
>> If you change the sub-arches to declare the smp operations as const,
>> and try and pass them into a function which doesn't take a const-pointer,
>> you'll get a warning.  The core bits need to go in first before the
>> sub-arch patches.
>
> Ah yes, my bad.
>
>> I think the series has limited value - it allows us to (a) check that a
>> small quantity of code doesn't write to these things, and (b) allows us
>> to move the SMP operations structure from __initdata to __initconstdata.
>> It's still going to end up in the init region which is read/write in any
>> case, and still gets thrown away.
>>
>> Given where we are, I don't think we need to rush this in during the
>> last week before the merge window opens, even though it's trivial.
>
> Agreed. So if you pick it up for 4.4, we'll get the rest for 4.5.
>

OK.

I will put 01 and 02 to Russell's patch tracker
(after waiting for a bit more comments just in case).

I will do the rest later.





-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2015-08-25  1:37 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24  4:36 [PATCH 00/18] ARM: use const and __initconst for smp_operations Masahiro Yamada
2015-08-24  4:36 ` [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops() Masahiro Yamada
2015-08-24 20:33   ` Stephen Boyd
2015-08-24  4:36 ` [PATCH 02/18] ARM: add const qualifier to smp_operations member in structures Masahiro Yamada
2015-08-24  4:36 ` [PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations Masahiro Yamada
2015-08-24  4:36 ` [PATCH 04/18] ARM: axxia: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 05/18] ARM: BCM: " Masahiro Yamada
2015-08-24 18:33   ` Florian Fainelli
2015-08-24 20:24     ` Ray Jui
2015-08-24  4:36 ` [PATCH 06/18] ARM: berlin: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 07/18] ARM: EXYNOS: " Masahiro Yamada
2015-08-24  7:17   ` Krzysztof Kozlowski
2015-08-24  4:36 ` [PATCH 08/18] ARM: hisi: do not export smp_operations structures Masahiro Yamada
2015-08-24  4:36 ` [PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations Masahiro Yamada
2015-08-24  4:36 ` [PATCH 10/18] ARM: mvebu: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 11/18] ARM: qcom: " Masahiro Yamada
2015-08-24 19:36   ` Andy Gross
2015-08-24  4:36 ` [PATCH 12/18] ARM: rockchip: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 13/18] ARM: socfpga: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 14/18] ARM: sunxi: " Masahiro Yamada
2015-08-24  6:22   ` Maxime Ripard
2015-08-24  4:36 ` [PATCH 15/18] ARM: uniphier: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 16/18] ARM: zx: " Masahiro Yamada
2015-08-24  4:36 ` [PATCH 17/18] ARM: zynq: " Masahiro Yamada
2015-08-24 19:58   ` Moritz Fischer
2015-08-24  4:36 ` [PATCH 18/18] ARM: mcpm: " Masahiro Yamada
2015-08-24 21:12 ` [PATCH 00/18] ARM: " Olof Johansson
2015-08-24 21:21   ` Russell King - ARM Linux
2015-08-24 21:44     ` Olof Johansson
2015-08-25  1:37       ` Masahiro Yamada

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