aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhumika Goyal <bhumirks@gmail.com>2017-01-14 07:31:54 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-23 11:21:34 -0500
commitcbc41b43e7c2ba6503b6b96dfe38e6b1316f46cf (patch)
tree52d30e253e4d0b4ef4f317c515fc964ce9dbd5d5
parentbc49a7831b1137ce1c2dda1c57e3631655f5d2ae (diff)
sparc32: mm: srmmu: add __ro_after_init to sparc32_cachetlb_ops structures
The objects viking_ops, viking_sun4d_smp_ops and smp_cachetlb_ops of type sparc32_cachetlb_ops are not modified anywhere after getting modified in the init functions. Inside init their reference is also stored in a pointer of type const struct sparc32_cachetlb_ops *. So these structures are never modified after init, therefore add __ro_after to the declaration of these structures. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc/mm/srmmu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index c7f2a5295b3a..def82f6d626f 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -1444,7 +1444,7 @@ static void poke_viking(void)
1444 srmmu_set_mmureg(mreg); 1444 srmmu_set_mmureg(mreg);
1445} 1445}
1446 1446
1447static struct sparc32_cachetlb_ops viking_ops = { 1447static struct sparc32_cachetlb_ops viking_ops __ro_after_init = {
1448 .cache_all = viking_flush_cache_all, 1448 .cache_all = viking_flush_cache_all,
1449 .cache_mm = viking_flush_cache_mm, 1449 .cache_mm = viking_flush_cache_mm,
1450 .cache_page = viking_flush_cache_page, 1450 .cache_page = viking_flush_cache_page,
@@ -1475,7 +1475,7 @@ static struct sparc32_cachetlb_ops viking_ops = {
1475 * flushes going at once will require SMP locking anyways so there's 1475 * flushes going at once will require SMP locking anyways so there's
1476 * no real value in trying any harder than this. 1476 * no real value in trying any harder than this.
1477 */ 1477 */
1478static struct sparc32_cachetlb_ops viking_sun4d_smp_ops = { 1478static struct sparc32_cachetlb_ops viking_sun4d_smp_ops __ro_after_init = {
1479 .cache_all = viking_flush_cache_all, 1479 .cache_all = viking_flush_cache_all,
1480 .cache_mm = viking_flush_cache_mm, 1480 .cache_mm = viking_flush_cache_mm,
1481 .cache_page = viking_flush_cache_page, 1481 .cache_page = viking_flush_cache_page,
@@ -1759,7 +1759,7 @@ static void smp_flush_sig_insns(struct mm_struct *mm, unsigned long insn_addr)
1759 local_ops->sig_insns(mm, insn_addr); 1759 local_ops->sig_insns(mm, insn_addr);
1760} 1760}
1761 1761
1762static struct sparc32_cachetlb_ops smp_cachetlb_ops = { 1762static struct sparc32_cachetlb_ops smp_cachetlb_ops __ro_after_init = {
1763 .cache_all = smp_flush_cache_all, 1763 .cache_all = smp_flush_cache_all,
1764 .cache_mm = smp_flush_cache_mm, 1764 .cache_mm = smp_flush_cache_mm,
1765 .cache_page = smp_flush_cache_page, 1765 .cache_page = smp_flush_cache_page,