From 75305275a721d33ae9abfaeed2817cec8b2fee9a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 15 Nov 2015 10:39:53 +0900 Subject: ARM: use const and __initconst for smp_operations These smp_operations structures are not over-written, so add "const" qualifier and replace __initdata with __initconst. Also, add "static" where it is possible. Signed-off-by: Masahiro Yamada Acked-by: Krzysztof Kozlowski Acked-by: Maxime Ripard Acked-by: Moritz Fischer Acked-by: Stephen Boyd # qcom part Acked-by: Viresh Kumar Acked-by: Patrice Chotard Acked-by: Heiko Stuebner Acked-by: Wei Xu Acked-by: Florian Fainelli Acked-by: Sebastian Hesselbarth Acked-by: Gregory CLEMENT Acked-by: Shawn Guo Acked-by: Matthias Brugger Acked-by: Thierry Reding Acked-by: Nicolas Pitre Acked-by: Liviu Dudau Acked-by: Linus Walleij Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/common.h | 4 ++-- arch/arm/mach-imx/platsmp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index e2d53839fceb..32b83f09da18 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -153,7 +153,7 @@ void imx_init_l2cache(void); static inline void imx_init_l2cache(void) {} #endif -extern struct smp_operations imx_smp_ops; -extern struct smp_operations ls1021a_smp_ops; +extern const struct smp_operations imx_smp_ops; +extern const struct smp_operations ls1021a_smp_ops; #endif diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c index 7f270015fe58..711dbbd5badd 100644 --- a/arch/arm/mach-imx/platsmp.c +++ b/arch/arm/mach-imx/platsmp.c @@ -88,7 +88,7 @@ static void __init imx_smp_prepare_cpus(unsigned int max_cpus) sync_cache_w(&g_diag_reg); } -struct smp_operations imx_smp_ops __initdata = { +const struct smp_operations imx_smp_ops __initconst = { .smp_init_cpus = imx_smp_init_cpus, .smp_prepare_cpus = imx_smp_prepare_cpus, .smp_boot_secondary = imx_boot_secondary, @@ -123,7 +123,7 @@ static void __init ls1021a_smp_prepare_cpus(unsigned int max_cpus) iounmap(dcfg_base); } -struct smp_operations ls1021a_smp_ops __initdata = { +const struct smp_operations ls1021a_smp_ops __initconst = { .smp_prepare_cpus = ls1021a_smp_prepare_cpus, .smp_boot_secondary = ls1021a_boot_secondary, }; -- cgit v1.2.3 From e324654294907a420ab3773efe8849a935f37bf0 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 16 Nov 2015 12:06:10 +0900 Subject: ARM: use "depends on" for SoC configs instead of "if" after prompt Many ARM sub-architectures use prompts followed by "if" conditional, but it is wrong. Please notice the difference between config ARCH_FOO bool "Foo SoCs" if ARCH_MULTI_V7 and config ARCH_FOO bool "Foo SoCs" depends on ARCH_MULTI_V7 These two are *not* equivalent! In the former statement, it is not ARCH_FOO, but its prompt that depends on ARCH_MULTI_V7. So, it is completely valid that ARCH_FOO is selected by another, but ARCH_MULTI_V7 is still disabled. As it is not unmet dependency, Kconfig never warns. This is probably not what you want. The former should be used only when you need to do so, and you really understand what you are doing. (In most cases, it should be wrong!) For enabling/disabling sub-architectures, the latter is always correct. As a good side effect, this commit fixes some entries over 80 columns (mach-imx, mach-integrator, mach-mbevu). [Arnd: I note that there is not really a bug here, according to the discussion that followed, but I can see value in being consistent and in making the lines shorter] Signed-off-by: Masahiro Yamada Acked-by: Maxime Ripard Acked-by: Nicolas Ferre Acked-by: Heiko Stuebner Acked-by: Patrice Chotard Acked-by: Liviu Dudau Acked-by: Krzysztof Kozlowski Acked-by: Jun Nie Acked-by: Matthias Brugger Acked-by: Simon Horman Acked-by: Gregory CLEMENT Acked-by: Shawn Guo Acked-by: Sebastian Hesselbarth Acked-by: Thierry Reding Acked-by: Krzysztof Halasa Acked-by: Maxime Coquelin Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-imx') diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 8ceda2844c4f..0ac180f7b330 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -1,5 +1,6 @@ menuconfig ARCH_MXC - bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M + bool "Freescale i.MX family" + depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M select ARCH_REQUIRE_GPIOLIB select ARM_CPU_SUSPEND if PM select CLKSRC_IMX_GPT @@ -596,7 +597,8 @@ choice default VF_USE_ARM_GLOBAL_TIMER config VF_USE_ARM_GLOBAL_TIMER - bool "Use ARM Global Timer" if ARCH_MULTI_V7 + bool "Use ARM Global Timer" + depends on ARCH_MULTI_V7 select ARM_GLOBAL_TIMER select CLKSRC_ARM_GLOBAL_TIMER_SCHED_CLOCK help -- cgit v1.2.3