From ff2c8252bfbf069dda1e53353a63b560f1369f59 Mon Sep 17 00:00:00 2001 From: Matt Redfearn Date: Wed, 19 Jul 2017 09:21:03 +0100 Subject: MIPS: SMP: Constify smp ops smp_ops providers do not modify their ops structures, so they should be made const for robustness. Since currently the MIPS kernel is not mapped with memory protection, this does not in itself provide any security benefit, but it still makes sense to make this change. There are also slight code size efficincies from the structure being made read-only, saving 128 bytes of kernel text on a pistachio_defconfig. Before: text data bss dec hex filename 7187239 1772752 470224 9430215 8fe4c7 vmlinux After: text data bss dec hex filename 7187111 1772752 470224 9430087 8fe447 vmlinux Signed-off-by: Matt Redfearn Cc: Sebastian Andrzej Siewior Cc: Arnd Bergmann Cc: Marcin Nowakowski Cc: Bart Van Assche Cc: Masahiro Yamada Cc: Huacai Chen Cc: Paul Gortmaker Cc: Kevin Cernekee Cc: Thomas Gleixner Cc: Doug Ledford Cc: James Hogan Cc: Joe Perches Cc: Florian Fainelli Cc: Ingo Molnar Cc: Paul Burton Cc: Andrew Morton Cc: Steven J. Hill Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/16784/ Signed-off-by: Ralf Baechle --- arch/mips/include/asm/mach-loongson64/loongson.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/mips/include/asm/mach-loongson64/loongson.h') diff --git a/arch/mips/include/asm/mach-loongson64/loongson.h b/arch/mips/include/asm/mach-loongson64/loongson.h index c68c0cc879c6..d0ae5d55413b 100644 --- a/arch/mips/include/asm/mach-loongson64/loongson.h +++ b/arch/mips/include/asm/mach-loongson64/loongson.h @@ -26,7 +26,7 @@ extern void mach_prepare_shutdown(void); /* environment arguments from bootloader */ extern u32 cpu_clock_freq; extern u32 memsize, highmemsize; -extern struct plat_smp_ops loongson3_smp_ops; +extern const struct plat_smp_ops loongson3_smp_ops; /* loongson-specific command line, env and memory initialization */ extern void __init prom_init_memory(void); -- cgit