Skip to content

Commit af71bcf

Browse files
Anton Vorontsovkumargala
authored andcommitted
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>
1 parent 2069a6a commit af71bcf

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎arch/powerpc/include/asm/cpm1.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef __CPM1__
1818
#define __CPM1__
1919

20+
#include <linux/init.h>
2021
#include <asm/8xx_immap.h>
2122
#include <asm/ptrace.h>
2223
#include <asm/cpm.h>
@@ -54,7 +55,7 @@ extern cpm8xx_t __iomem *cpmp; /* Pointer to comm processor */
5455

5556
extern void cpm_setbrg(uint brg, uint rate);
5657

57-
extern void cpm_load_patch(cpm8xx_t *cp);
58+
extern void __init cpm_load_patch(cpm8xx_t *cp);
5859

5960
extern void cpm_reset(void);
6061

‎arch/powerpc/sysdev/micropatch.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* also relocates SMC2, but this would require additional changes
55
* to uart.c, so I am holding off on that for a moment.
66
*/
7+
#include <linux/init.h>
78
#include <linux/errno.h>
89
#include <linux/sched.h>
910
#include <linux/kernel.h>
@@ -25,7 +26,7 @@
2526

2627
#ifdef CONFIG_I2C_SPI_UCODE_PATCH
2728

28-
uint patch_2000[] = {
29+
static uint patch_2000[] __initdata = {
2930
0x7FFFEFD9,
3031
0x3FFD0000,
3132
0x7FFB49F7,
@@ -144,7 +145,7 @@ uint patch_2000[] = {
144145
0x5F8247F8
145146
};
146147

147-
uint patch_2f00[] = {
148+
static uint patch_2f00[] __initdata = {
148149
0x3E303430,
149150
0x34343737,
150151
0xABF7BF9B,
@@ -183,7 +184,7 @@ uint patch_2f00[] = {
183184

184185
#ifdef CONFIG_I2C_SPI_SMC1_UCODE_PATCH
185186

186-
uint patch_2000[] = {
187+
static uint patch_2000[] __initdata = {
187188
0x3fff0000,
188189
0x3ffd0000,
189190
0x3ffb0000,
@@ -506,7 +507,7 @@ uint patch_2000[] = {
506507
0x6079e2bb
507508
};
508509

509-
uint patch_2f00[] = {
510+
static uint patch_2f00[] __initdata = {
510511
0x30303030,
511512
0x3e3e3434,
512513
0xabbf9b99,
@@ -573,7 +574,7 @@ uint patch_2f00[] = {
573574
0xf22f3f23
574575
};
575576

576-
uint patch_2e00[] = {
577+
static uint patch_2e00[] __initdata = {
577578
0x27eeeeee,
578579
0xeeeeeeee,
579580
0xeeeeeeee,
@@ -599,7 +600,7 @@ uint patch_2e00[] = {
599600

600601
#ifdef CONFIG_USB_SOF_UCODE_PATCH
601602

602-
uint patch_2000[] = {
603+
static uint patch_2000[] __initdata = {
603604
0x7fff0000,
604605
0x7ffd0000,
605606
0x7ffb0000,
@@ -614,15 +615,14 @@ uint patch_2000[] = {
614615
0x60750000
615616
};
616617

617-
uint patch_2f00[] = {
618+
static uint patch_2f00[] __initdata = {
618619
0x3030304c,
619620
0xcab9e441,
620621
0xa1aaf220
621622
};
622623
#endif
623624

624-
void
625-
cpm_load_patch(cpm8xx_t *cp)
625+
void __init cpm_load_patch(cpm8xx_t *cp)
626626
{
627627
volatile uint *dp; /* Dual-ported RAM. */
628628
volatile cpm8xx_t *commproc;

0 commit comments

Comments
 (0)