Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/cpm1: Mark micropatch code/data static and __init

This saves runtime memory and fixes lots of sparse warnings like this:

CHECK arch/powerpc/sysdev/micropatch.c
arch/powerpc/sysdev/micropatch.c:27:6: warning: symbol 'patch_2000'
was not declared. Should it be static?
arch/powerpc/sysdev/micropatch.c:146:6: warning: symbol 'patch_2f00'
was not declared. Should it be static?
...

Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

authored by

Anton Vorontsov and committed by
Kumar Gala
af71bcfe 2069a6ae

+11 -10
+2 -1
arch/powerpc/include/asm/cpm1.h
··· 17 17 #ifndef __CPM1__ 18 18 #define __CPM1__ 19 19 20 + #include <linux/init.h> 20 21 #include <asm/8xx_immap.h> 21 22 #include <asm/ptrace.h> 22 23 #include <asm/cpm.h> ··· 55 54 56 55 extern void cpm_setbrg(uint brg, uint rate); 57 56 58 - extern void cpm_load_patch(cpm8xx_t *cp); 57 + extern void __init cpm_load_patch(cpm8xx_t *cp); 59 58 60 59 extern void cpm_reset(void); 61 60
+9 -9
arch/powerpc/sysdev/micropatch.c
··· 4 4 * also relocates SMC2, but this would require additional changes 5 5 * to uart.c, so I am holding off on that for a moment. 6 6 */ 7 + #include <linux/init.h> 7 8 #include <linux/errno.h> 8 9 #include <linux/sched.h> 9 10 #include <linux/kernel.h> ··· 26 25 27 26 #ifdef CONFIG_I2C_SPI_UCODE_PATCH 28 27 29 - uint patch_2000[] = { 28 + static uint patch_2000[] __initdata = { 30 29 0x7FFFEFD9, 31 30 0x3FFD0000, 32 31 0x7FFB49F7, ··· 145 144 0x5F8247F8 146 145 }; 147 146 148 - uint patch_2f00[] = { 147 + static uint patch_2f00[] __initdata = { 149 148 0x3E303430, 150 149 0x34343737, 151 150 0xABF7BF9B, ··· 184 183 185 184 #ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH 186 185 187 - uint patch_2000[] = { 186 + static uint patch_2000[] __initdata = { 188 187 0x3fff0000, 189 188 0x3ffd0000, 190 189 0x3ffb0000, ··· 507 506 0x6079e2bb 508 507 }; 509 508 510 - uint patch_2f00[] = { 509 + static uint patch_2f00[] __initdata = { 511 510 0x30303030, 512 511 0x3e3e3434, 513 512 0xabbf9b99, ··· 574 573 0xf22f3f23 575 574 }; 576 575 577 - uint patch_2e00[] = { 576 + static uint patch_2e00[] __initdata = { 578 577 0x27eeeeee, 579 578 0xeeeeeeee, 580 579 0xeeeeeeee, ··· 600 599 601 600 #ifdef CONFIG_USB_SOF_UCODE_PATCH 602 601 603 - uint patch_2000[] = { 602 + static uint patch_2000[] __initdata = { 604 603 0x7fff0000, 605 604 0x7ffd0000, 606 605 0x7ffb0000, ··· 615 614 0x60750000 616 615 }; 617 616 618 - uint patch_2f00[] = { 617 + static uint patch_2f00[] __initdata = { 619 618 0x3030304c, 620 619 0xcab9e441, 621 620 0xa1aaf220 622 621 }; 623 622 #endif 624 623 625 - void 626 - cpm_load_patch(cpm8xx_t *cp) 624 + void __init cpm_load_patch(cpm8xx_t *cp) 627 625 { 628 626 volatile uint *dp; /* Dual-ported RAM. */ 629 627 volatile cpm8xx_t *commproc;