diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-05-08 00:27:16 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-05-14 08:31:55 -0400 |
commit | 9f1067c2d98ac1c43f0c82892f5647774a6ac759 (patch) | |
tree | 09dfc23d99a0702e78ef1b1e2598d59d65b0af99 /arch/powerpc/xmon/xmon.c | |
parent | af3b74df1b2fa4dbfb0534818167f6393f5ae7c7 (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/xmon.c')
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 59 |
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); | |||
154 | static void dump_tlb_44x(void); | 154 | static void dump_tlb_44x(void); |
155 | #endif | 155 | #endif |
156 | 156 | ||
157 | int xmon_no_auto_backtrace; | 157 | static int xmon_no_auto_backtrace; |
158 | 158 | ||
159 | extern void xmon_enter(void); | 159 | extern void xmon_enter(void); |
160 | extern void xmon_leave(void); | 160 | extern 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 | ||
1373 | void excprint(struct pt_regs *fp) | 1373 | static 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 | ||
1411 | void prregs(struct pt_regs *fp) | 1411 | static 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 | ||
1466 | void cacheflush(void) | 1466 | static 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 | ||
1498 | unsigned long | 1498 | static unsigned long |
1499 | read_spr(int n) | 1499 | read_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 | ||
1536 | void | 1536 | static void |
1537 | write_spr(int n, unsigned long val) | 1537 | write_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; | |||
1571 | extern char exc_prolog; | 1571 | extern char exc_prolog; |
1572 | extern char dec_exc; | 1572 | extern char dec_exc; |
1573 | 1573 | ||
1574 | void super_regs(void) | 1574 | static 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 | */ |
1632 | int | 1632 | static int |
1633 | mread(unsigned long adrs, void *buf, int size) | 1633 | mread(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 | ||
1669 | int | 1669 | static int |
1670 | mwrite(unsigned long adrs, void *buf, int size) | 1670 | mwrite(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 | ||
1734 | void | 1734 | static void |
1735 | byterev(unsigned char *val, int size) | 1735 | byterev(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 | ||
1796 | void | 1796 | static void |
1797 | memex(void) | 1797 | memex(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 | ||
1947 | int | 1947 | static int |
1948 | bsesc(void) | 1948 | bsesc(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')) |
1987 | void | 1987 | static void |
1988 | dump(void) | 1988 | dump(void) |
1989 | { | 1989 | { |
1990 | int c; | 1990 | int c; |
@@ -2022,7 +2022,7 @@ dump(void) | |||
2022 | } | 2022 | } |
2023 | } | 2023 | } |
2024 | 2024 | ||
2025 | void | 2025 | static void |
2026 | prdump(unsigned long adrs, long ndump) | 2026 | prdump(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 | ||
2067 | typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr); | 2067 | typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr); |
2068 | 2068 | ||
2069 | int | 2069 | static int |
2070 | generic_inst_dump(unsigned long adr, long count, int praddr, | 2070 | generic_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 | ||
2107 | int | 2107 | static int |
2108 | ppc_inst_dump(unsigned long adr, long count, int praddr) | 2108 | ppc_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 */ | |||
2126 | static unsigned long mcount; /* # bytes to affect */ | 2126 | static unsigned long mcount; /* # bytes to affect */ |
2127 | static unsigned long mdiffs; /* max # differences to print */ | 2127 | static unsigned long mdiffs; /* max # differences to print */ |
2128 | 2128 | ||
2129 | void | 2129 | static void |
2130 | memops(int cmd) | 2130 | memops(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 | ||
2155 | void | 2155 | static void |
2156 | memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr) | 2156 | memdiffs(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) | |||
2170 | static unsigned mend; | 2170 | static unsigned mend; |
2171 | static unsigned mask; | 2171 | static unsigned mask; |
2172 | 2172 | ||
2173 | void | 2173 | static void |
2174 | memlocate(void) | 2174 | memlocate(void) |
2175 | { | 2175 | { |
2176 | unsigned a, n; | 2176 | unsigned a, n; |
@@ -2203,7 +2203,7 @@ memlocate(void) | |||
2203 | static unsigned long mskip = 0x1000; | 2203 | static unsigned long mskip = 0x1000; |
2204 | static unsigned long mlim = 0xffffffff; | 2204 | static unsigned long mlim = 0xffffffff; |
2205 | 2205 | ||
2206 | void | 2206 | static void |
2207 | memzcan(void) | 2207 | memzcan(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 | ||
2233 | void proccall(void) | 2233 | static 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 | ||
2391 | void | 2391 | static void |
2392 | scannl(void) | 2392 | scannl(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 | ||
2402 | int hexdigit(int c) | 2402 | static 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) | |||
2430 | static char line[256]; | 2430 | static char line[256]; |
2431 | static char *lineptr; | 2431 | static char *lineptr; |
2432 | 2432 | ||
2433 | void | 2433 | static void |
2434 | flush_input(void) | 2434 | flush_input(void) |
2435 | { | 2435 | { |
2436 | lineptr = NULL; | 2436 | lineptr = NULL; |
2437 | } | 2437 | } |
2438 | 2438 | ||
2439 | int | 2439 | static int |
2440 | inchar(void) | 2440 | inchar(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 | ||
2452 | void | 2452 | static void |
2453 | take_input(char *str) | 2453 | take_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 */ |
2621 | void xmon_init(int enable) | 2621 | |
2622 | static 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)) |