aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/xmon
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2008-05-08 00:27:16 -0400
committerPaul Mackerras <paulus@samba.org>2008-05-14 08:31:55 -0400
commit9f1067c2d98ac1c43f0c82892f5647774a6ac759 (patch)
tree09dfc23d99a0702e78ef1b1e2598d59d65b0af99 /arch/powerpc/xmon
parentaf3b74df1b2fa4dbfb0534818167f6393f5ae7c7 (diff)
[POWERPC] Fix sparse warnings in xmon.c
warning: Using plain integer as NULL pointer warning: Using plain integer as NULL pointer warning: symbol 'excprint' was not declared. Should it be static? warning: symbol 'prregs' was not declared. Should it be static? warning: symbol 'cacheflush' was not declared. Should it be static? warning: symbol 'read_spr' was not declared. Should it be static? warning: symbol 'write_spr' was not declared. Should it be static? warning: symbol 'super_regs' was not declared. Should it be static? warning: symbol 'mread' was not declared. Should it be static? warning: symbol 'mwrite' was not declared. Should it be static? warning: symbol 'byterev' was not declared. Should it be static? warning: symbol 'memex' was not declared. Should it be static? warning: symbol 'bsesc' was not declared. Should it be static? warning: symbol 'dump' was not declared. Should it be static? warning: symbol 'prdump' was not declared. Should it be static? warning: symbol 'generic_inst_dump' was not declared. Should it be static? warning: symbol 'ppc_inst_dump' was not declared. Should it be static? warning: symbol 'memops' was not declared. Should it be static? warning: symbol 'memdiffs' was not declared. Should it be static? warning: symbol 'memlocate' was not declared. Should it be static? warning: symbol 'memzcan' was not declared. Should it be static? warning: symbol 'proccall' was not declared. Should it be static? warning: symbol 'scannl' was not declared. Should it be static? warning: symbol 'hexdigit' was not declared. Should it be static? warning: symbol 'flush_input' was not declared. Should it be static? warning: symbol 'inchar' was not declared. Should it be static? warning: symbol 'take_input' was not declared. Should it be static? warning: symbol 'xmon_init' was not declared. Should it be static? Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/xmon')
-rw-r--r--arch/powerpc/xmon/xmon.c59
1 files changed, 30 insertions, 29 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 1702de9395ee..95f24c9822b1 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -154,7 +154,7 @@ static int do_spu_cmd(void);
154static void dump_tlb_44x(void); 154static void dump_tlb_44x(void);
155#endif 155#endif
156 156
157int xmon_no_auto_backtrace; 157static int xmon_no_auto_backtrace;
158 158
159extern void xmon_enter(void); 159extern void xmon_enter(void);
160extern void xmon_leave(void); 160extern void xmon_leave(void);
@@ -593,7 +593,7 @@ static int xmon_iabr_match(struct pt_regs *regs)
593{ 593{
594 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) 594 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
595 return 0; 595 return 0;
596 if (iabr == 0) 596 if (iabr == NULL)
597 return 0; 597 return 0;
598 xmon_core(regs, 0); 598 xmon_core(regs, 0);
599 return 1; 599 return 1;
@@ -1142,7 +1142,7 @@ bpt_cmds(void)
1142 } else { 1142 } else {
1143 /* assume a breakpoint address */ 1143 /* assume a breakpoint address */
1144 bp = at_breakpoint(a); 1144 bp = at_breakpoint(a);
1145 if (bp == 0) { 1145 if (bp == NULL) {
1146 printf("No breakpoint at %x\n", a); 1146 printf("No breakpoint at %x\n", a);
1147 break; 1147 break;
1148 } 1148 }
@@ -1370,7 +1370,7 @@ static void print_bug_trap(struct pt_regs *regs)
1370#endif 1370#endif
1371} 1371}
1372 1372
1373void excprint(struct pt_regs *fp) 1373static void excprint(struct pt_regs *fp)
1374{ 1374{
1375 unsigned long trap; 1375 unsigned long trap;
1376 1376
@@ -1408,7 +1408,7 @@ void excprint(struct pt_regs *fp)
1408 print_bug_trap(fp); 1408 print_bug_trap(fp);
1409} 1409}
1410 1410
1411void prregs(struct pt_regs *fp) 1411static void prregs(struct pt_regs *fp)
1412{ 1412{
1413 int n, trap; 1413 int n, trap;
1414 unsigned long base; 1414 unsigned long base;
@@ -1463,7 +1463,7 @@ void prregs(struct pt_regs *fp)
1463 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); 1463 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr);
1464} 1464}
1465 1465
1466void cacheflush(void) 1466static void cacheflush(void)
1467{ 1467{
1468 int cmd; 1468 int cmd;
1469 unsigned long nflush; 1469 unsigned long nflush;
@@ -1495,7 +1495,7 @@ void cacheflush(void)
1495 catch_memory_errors = 0; 1495 catch_memory_errors = 0;
1496} 1496}
1497 1497
1498unsigned long 1498static unsigned long
1499read_spr(int n) 1499read_spr(int n)
1500{ 1500{
1501 unsigned int instrs[2]; 1501 unsigned int instrs[2];
@@ -1533,7 +1533,7 @@ read_spr(int n)
1533 return ret; 1533 return ret;
1534} 1534}
1535 1535
1536void 1536static void
1537write_spr(int n, unsigned long val) 1537write_spr(int n, unsigned long val)
1538{ 1538{
1539 unsigned int instrs[2]; 1539 unsigned int instrs[2];
@@ -1571,7 +1571,7 @@ static unsigned long regno;
1571extern char exc_prolog; 1571extern char exc_prolog;
1572extern char dec_exc; 1572extern char dec_exc;
1573 1573
1574void super_regs(void) 1574static void super_regs(void)
1575{ 1575{
1576 int cmd; 1576 int cmd;
1577 unsigned long val; 1577 unsigned long val;
@@ -1629,7 +1629,7 @@ void super_regs(void)
1629/* 1629/*
1630 * Stuff for reading and writing memory safely 1630 * Stuff for reading and writing memory safely
1631 */ 1631 */
1632int 1632static int
1633mread(unsigned long adrs, void *buf, int size) 1633mread(unsigned long adrs, void *buf, int size)
1634{ 1634{
1635 volatile int n; 1635 volatile int n;
@@ -1666,7 +1666,7 @@ mread(unsigned long adrs, void *buf, int size)
1666 return n; 1666 return n;
1667} 1667}
1668 1668
1669int 1669static int
1670mwrite(unsigned long adrs, void *buf, int size) 1670mwrite(unsigned long adrs, void *buf, int size)
1671{ 1671{
1672 volatile int n; 1672 volatile int n;
@@ -1731,7 +1731,7 @@ static int handle_fault(struct pt_regs *regs)
1731 1731
1732#define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t)) 1732#define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t))
1733 1733
1734void 1734static void
1735byterev(unsigned char *val, int size) 1735byterev(unsigned char *val, int size)
1736{ 1736{
1737 int t; 1737 int t;
@@ -1793,7 +1793,7 @@ static char *memex_subcmd_help_string =
1793 " x exit this mode\n" 1793 " x exit this mode\n"
1794 ""; 1794 "";
1795 1795
1796void 1796static void
1797memex(void) 1797memex(void)
1798{ 1798{
1799 int cmd, inc, i, nslash; 1799 int cmd, inc, i, nslash;
@@ -1944,7 +1944,7 @@ memex(void)
1944 } 1944 }
1945} 1945}
1946 1946
1947int 1947static int
1948bsesc(void) 1948bsesc(void)
1949{ 1949{
1950 int c; 1950 int c;
@@ -1984,7 +1984,7 @@ static void xmon_rawdump (unsigned long adrs, long ndump)
1984#define isxdigit(c) (('0' <= (c) && (c) <= '9') \ 1984#define isxdigit(c) (('0' <= (c) && (c) <= '9') \
1985 || ('a' <= (c) && (c) <= 'f') \ 1985 || ('a' <= (c) && (c) <= 'f') \
1986 || ('A' <= (c) && (c) <= 'F')) 1986 || ('A' <= (c) && (c) <= 'F'))
1987void 1987static void
1988dump(void) 1988dump(void)
1989{ 1989{
1990 int c; 1990 int c;
@@ -2022,7 +2022,7 @@ dump(void)
2022 } 2022 }
2023} 2023}
2024 2024
2025void 2025static void
2026prdump(unsigned long adrs, long ndump) 2026prdump(unsigned long adrs, long ndump)
2027{ 2027{
2028 long n, m, c, r, nr; 2028 long n, m, c, r, nr;
@@ -2066,7 +2066,7 @@ prdump(unsigned long adrs, long ndump)
2066 2066
2067typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr); 2067typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr);
2068 2068
2069int 2069static int
2070generic_inst_dump(unsigned long adr, long count, int praddr, 2070generic_inst_dump(unsigned long adr, long count, int praddr,
2071 instruction_dump_func dump_func) 2071 instruction_dump_func dump_func)
2072{ 2072{
@@ -2104,7 +2104,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
2104 return adr - first_adr; 2104 return adr - first_adr;
2105} 2105}
2106 2106
2107int 2107static int
2108ppc_inst_dump(unsigned long adr, long count, int praddr) 2108ppc_inst_dump(unsigned long adr, long count, int praddr)
2109{ 2109{
2110 return generic_inst_dump(adr, count, praddr, print_insn_powerpc); 2110 return generic_inst_dump(adr, count, praddr, print_insn_powerpc);
@@ -2126,7 +2126,7 @@ static unsigned long mval; /* byte value to set memory to */
2126static unsigned long mcount; /* # bytes to affect */ 2126static unsigned long mcount; /* # bytes to affect */
2127static unsigned long mdiffs; /* max # differences to print */ 2127static unsigned long mdiffs; /* max # differences to print */
2128 2128
2129void 2129static void
2130memops(int cmd) 2130memops(int cmd)
2131{ 2131{
2132 scanhex((void *)&mdest); 2132 scanhex((void *)&mdest);
@@ -2152,7 +2152,7 @@ memops(int cmd)
2152 } 2152 }
2153} 2153}
2154 2154
2155void 2155static void
2156memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr) 2156memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
2157{ 2157{
2158 unsigned n, prt; 2158 unsigned n, prt;
@@ -2170,7 +2170,7 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
2170static unsigned mend; 2170static unsigned mend;
2171static unsigned mask; 2171static unsigned mask;
2172 2172
2173void 2173static void
2174memlocate(void) 2174memlocate(void)
2175{ 2175{
2176 unsigned a, n; 2176 unsigned a, n;
@@ -2203,7 +2203,7 @@ memlocate(void)
2203static unsigned long mskip = 0x1000; 2203static unsigned long mskip = 0x1000;
2204static unsigned long mlim = 0xffffffff; 2204static unsigned long mlim = 0xffffffff;
2205 2205
2206void 2206static void
2207memzcan(void) 2207memzcan(void)
2208{ 2208{
2209 unsigned char v; 2209 unsigned char v;
@@ -2230,7 +2230,7 @@ memzcan(void)
2230 printf("%.8x\n", a - mskip); 2230 printf("%.8x\n", a - mskip);
2231} 2231}
2232 2232
2233void proccall(void) 2233static void proccall(void)
2234{ 2234{
2235 unsigned long args[8]; 2235 unsigned long args[8];
2236 unsigned long ret; 2236 unsigned long ret;
@@ -2388,7 +2388,7 @@ scanhex(unsigned long *vp)
2388 return 1; 2388 return 1;
2389} 2389}
2390 2390
2391void 2391static void
2392scannl(void) 2392scannl(void)
2393{ 2393{
2394 int c; 2394 int c;
@@ -2399,7 +2399,7 @@ scannl(void)
2399 c = inchar(); 2399 c = inchar();
2400} 2400}
2401 2401
2402int hexdigit(int c) 2402static int hexdigit(int c)
2403{ 2403{
2404 if( '0' <= c && c <= '9' ) 2404 if( '0' <= c && c <= '9' )
2405 return c - '0'; 2405 return c - '0';
@@ -2430,13 +2430,13 @@ getstring(char *s, int size)
2430static char line[256]; 2430static char line[256];
2431static char *lineptr; 2431static char *lineptr;
2432 2432
2433void 2433static void
2434flush_input(void) 2434flush_input(void)
2435{ 2435{
2436 lineptr = NULL; 2436 lineptr = NULL;
2437} 2437}
2438 2438
2439int 2439static int
2440inchar(void) 2440inchar(void)
2441{ 2441{
2442 if (lineptr == NULL || *lineptr == 0) { 2442 if (lineptr == NULL || *lineptr == 0) {
@@ -2449,7 +2449,7 @@ inchar(void)
2449 return *lineptr++; 2449 return *lineptr++;
2450} 2450}
2451 2451
2452void 2452static void
2453take_input(char *str) 2453take_input(char *str)
2454{ 2454{
2455 lineptr = str; 2455 lineptr = str;
@@ -2618,7 +2618,8 @@ static void dump_tlb_44x(void)
2618 } 2618 }
2619} 2619}
2620#endif /* CONFIG_44x */ 2620#endif /* CONFIG_44x */
2621void xmon_init(int enable) 2621
2622static void xmon_init(int enable)
2622{ 2623{
2623#ifdef CONFIG_PPC_ISERIES 2624#ifdef CONFIG_PPC_ISERIES
2624 if (firmware_has_feature(FW_FEATURE_ISERIES)) 2625 if (firmware_has_feature(FW_FEATURE_ISERIES))