2015-08-24 04:38:20

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 00/18] ARM: use const and __initconst for smp_operations


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


2015-08-24 04:37:59

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:41:04

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 02/18] ARM: add const qualifier to smp_operations member in structures

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 <[email protected]>
---

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

2015-08-24 04:37:10

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:37:37

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 04/18] ARM: axxia: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:37:57

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations

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 <[email protected]>
---

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

2015-08-24 04:37:46

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 06/18] ARM: berlin: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:40:46

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:40:16

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 08/18] ARM: hisi: do not export smp_operations structures

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 <[email protected]>
---

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

2015-08-24 04:41:33

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:38:02

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 10/18] ARM: mvebu: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:37:49

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:37:55

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 12/18] ARM: rockchip: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:37:41

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 13/18] ARM: socfpga: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:38:45

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations

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 <[email protected]>
---

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

2015-08-24 04:37:31

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 15/18] ARM: uniphier: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:39:17

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 16/18] ARM: zx: use const and __initconst for smp_operations

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 <[email protected]>
---

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

2015-08-24 04:39:55

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations

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

Signed-off-by: Masahiro Yamada <[email protected]>
---

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

2015-08-24 04:38:58

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH 18/18] ARM: mcpm: use const and __initconst for smp_operations

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 <[email protected]>
---

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

2015-08-24 06:22:58

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations

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 <[email protected]>

Acked-by: Maxime Ripard <[email protected]>

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


Attachments:
(No filename) (475.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-08-24 07:17:27

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations

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 <[email protected]>
> ---
>
> 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 <[email protected]>

Best regards,
Krzysztof

2015-08-24 18:35:58

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations

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 <[email protected]>

For bcm63xx and brcmstb:

Reviewed-by: Florian Fainelli <[email protected]>

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

2015-08-24 19:36:19

by Andy Gross

[permalink] [raw]
Subject: Re: [PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations

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 <[email protected]>
> ---

Thanks!

Reviewed-by: Andy Gross <[email protected]>

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

2015-08-24 19:58:43

by Moritz Fischer

[permalink] [raw]
Subject: Re: [PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations

Acked-by: Moritz Fischer <[email protected]>

Thanks,

Moritz

On Mon, Aug 24, 2015 at 12:36 AM, Masahiro Yamada
<[email protected]> wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
>
> Signed-off-by: Masahiro Yamada <[email protected]>
> ---
>
> 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
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2015-08-24 20:24:31

by Ray Jui

[permalink] [raw]
Subject: Re: [PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations



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 <[email protected]>
>
> For bcm63xx and brcmstb:
>
> Reviewed-by: Florian Fainelli <[email protected]>
>
>> ---
>>
>> 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 <[email protected]>

Thanks,

Ray

2015-08-24 20:33:21

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()

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 <[email protected]>
> ---

Acked-by: Stephen Boyd <[email protected]>

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

2015-08-24 21:12:14

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH 00/18] ARM: use const and __initconst for smp_operations

On Sun, Aug 23, 2015 at 9:36 PM, Masahiro Yamada
<[email protected]> 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

2015-08-24 21:22:22

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 00/18] ARM: use const and __initconst for smp_operations

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.

2015-08-24 21:44:25

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH 00/18] ARM: use const and __initconst for smp_operations

On Mon, Aug 24, 2015 at 2:21 PM, Russell King - ARM Linux
<[email protected]> 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

2015-08-25 01:37:33

by Masahiro Yamada

[permalink] [raw]
Subject: Re: [PATCH 00/18] ARM: use const and __initconst for smp_operations

Hi Russell, Olof,

2015-08-25 6:44 GMT+09:00 Olof Johansson <[email protected]>:
> On Mon, Aug 24, 2015 at 2:21 PM, Russell King - ARM Linux
> <[email protected]> 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