From: Krzysztof Kozlowski <krzk@kernel.org> To: Sylwester Nawrocki <s.nawrocki@samsung.com>, Kukjin Kim <kgene@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org>, Javier Martinez Canillas <javier@osg.samsung.com>, Simtec Linux Team <linux@simtec.co.uk>, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] ARM: EXYNOS: Annotate iomem and pm_data pointers __ro_after_init Date: Sat, 10 Dec 2016 15:47:33 +0200 [thread overview] Message-ID: <1481377658-22603-2-git-send-email-krzk@kernel.org> (raw) In-Reply-To: <1481377658-22603-1-git-send-email-krzk@kernel.org> The pointers to __iomem sysram and exynos_pm_data are set only during initcalls. Later the pointers itself are used only in read-only way so we can mark them __ro_after_init to increase code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- arch/arm/mach-exynos/exynos.c | 4 ++-- arch/arm/mach-exynos/mcpm-exynos.c | 2 +- arch/arm/mach-exynos/suspend.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index fa08ef99b4ad..a863f8ec0f7a 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -36,8 +36,8 @@ static struct platform_device exynos_cpuidle = { .id = -1, }; -void __iomem *sysram_base_addr; -void __iomem *sysram_ns_base_addr; +void __iomem *sysram_base_addr __ro_after_init; +void __iomem *sysram_ns_base_addr __ro_after_init; void __init exynos_sysram_init(void) { diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index f086bf615b29..038fd8c993d0 100644 --- a/arch/arm/mach-exynos/mcpm-exynos.c +++ b/arch/arm/mach-exynos/mcpm-exynos.c @@ -32,7 +32,7 @@ #define EXYNOS5420_USE_ARM_CORE_DOWN_STATE BIT(29) #define EXYNOS5420_USE_L2_COMMON_UP_STATE BIT(30) -static void __iomem *ns_sram_base_addr; +static void __iomem *ns_sram_base_addr __ro_after_init; /* * The common v7_exit_coherency_flush API could not be used because of the diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index d0e6ac7938f3..339fe011d658 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -64,7 +64,7 @@ struct exynos_pm_data { int (*cpu_suspend)(unsigned long); }; -static const struct exynos_pm_data *pm_data; +static const struct exynos_pm_data *pm_data __ro_after_init; static int exynos5420_cpu_state; static unsigned int exynos_pmu_spare3; -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: krzk@kernel.org (Krzysztof Kozlowski) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/7] ARM: EXYNOS: Annotate iomem and pm_data pointers __ro_after_init Date: Sat, 10 Dec 2016 15:47:33 +0200 [thread overview] Message-ID: <1481377658-22603-2-git-send-email-krzk@kernel.org> (raw) In-Reply-To: <1481377658-22603-1-git-send-email-krzk@kernel.org> The pointers to __iomem sysram and exynos_pm_data are set only during initcalls. Later the pointers itself are used only in read-only way so we can mark them __ro_after_init to increase code safeness. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> --- arch/arm/mach-exynos/exynos.c | 4 ++-- arch/arm/mach-exynos/mcpm-exynos.c | 2 +- arch/arm/mach-exynos/suspend.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index fa08ef99b4ad..a863f8ec0f7a 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -36,8 +36,8 @@ static struct platform_device exynos_cpuidle = { .id = -1, }; -void __iomem *sysram_base_addr; -void __iomem *sysram_ns_base_addr; +void __iomem *sysram_base_addr __ro_after_init; +void __iomem *sysram_ns_base_addr __ro_after_init; void __init exynos_sysram_init(void) { diff --git a/arch/arm/mach-exynos/mcpm-exynos.c b/arch/arm/mach-exynos/mcpm-exynos.c index f086bf615b29..038fd8c993d0 100644 --- a/arch/arm/mach-exynos/mcpm-exynos.c +++ b/arch/arm/mach-exynos/mcpm-exynos.c @@ -32,7 +32,7 @@ #define EXYNOS5420_USE_ARM_CORE_DOWN_STATE BIT(29) #define EXYNOS5420_USE_L2_COMMON_UP_STATE BIT(30) -static void __iomem *ns_sram_base_addr; +static void __iomem *ns_sram_base_addr __ro_after_init; /* * The common v7_exit_coherency_flush API could not be used because of the diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index d0e6ac7938f3..339fe011d658 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -64,7 +64,7 @@ struct exynos_pm_data { int (*cpu_suspend)(unsigned long); }; -static const struct exynos_pm_data *pm_data; +static const struct exynos_pm_data *pm_data __ro_after_init; static int exynos5420_cpu_state; static unsigned int exynos_pmu_spare3; -- 2.7.4
next prev parent reply other threads:[~2016-12-10 13:48 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-12-10 13:47 [PATCH 1/7] ARM: EXYNOS: Constify list of retention registers Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski [this message] 2016-12-10 13:47 ` [PATCH 2/7] ARM: EXYNOS: Annotate iomem and pm_data pointers __ro_after_init Krzysztof Kozlowski 2016-12-10 13:47 ` [PATCH 3/7] ARM: s3c24xx: Constify few integer tables Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-10 13:47 ` [RFC 4/7] ARM: s3c64xx: Annotate external clock frequencies __ro_after_init Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-10 13:47 ` [PATCH 5/7] ARM: SAMSUNG: Constify array of wake irqs passed to samsung_sync_wakemask Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-10 13:47 ` [PATCH 6/7] ARM: s3c24xx: Constify wake_irqs Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-10 13:47 ` [PATCH 7/7] ARM: s3c64xx: " Krzysztof Kozlowski 2016-12-10 13:47 ` Krzysztof Kozlowski 2016-12-12 13:39 ` [PATCH 1/7] ARM: EXYNOS: Constify list of retention registers Bartlomiej Zolnierkiewicz 2016-12-12 13:39 ` Bartlomiej Zolnierkiewicz
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1481377658-22603-2-git-send-email-krzk@kernel.org \ --to=krzk@kernel.org \ --cc=javier@osg.samsung.com \ --cc=kgene@kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=linux@simtec.co.uk \ --cc=s.nawrocki@samsung.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.