Commit 9f1067c2 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent af3b74df
...@@ -154,7 +154,7 @@ static int do_spu_cmd(void); ...@@ -154,7 +154,7 @@ static int do_spu_cmd(void);
static void dump_tlb_44x(void); static void dump_tlb_44x(void);
#endif #endif
int xmon_no_auto_backtrace; static int xmon_no_auto_backtrace;
extern void xmon_enter(void); extern void xmon_enter(void);
extern void xmon_leave(void); extern void xmon_leave(void);
...@@ -593,7 +593,7 @@ static int xmon_iabr_match(struct pt_regs *regs) ...@@ -593,7 +593,7 @@ static int xmon_iabr_match(struct pt_regs *regs)
{ {
if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF)) if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) != (MSR_IR|MSR_SF))
return 0; return 0;
if (iabr == 0) if (iabr == NULL)
return 0; return 0;
xmon_core(regs, 0); xmon_core(regs, 0);
return 1; return 1;
...@@ -1142,7 +1142,7 @@ bpt_cmds(void) ...@@ -1142,7 +1142,7 @@ bpt_cmds(void)
} else { } else {
/* assume a breakpoint address */ /* assume a breakpoint address */
bp = at_breakpoint(a); bp = at_breakpoint(a);
if (bp == 0) { if (bp == NULL) {
printf("No breakpoint at %x\n", a); printf("No breakpoint at %x\n", a);
break; break;
} }
...@@ -1370,7 +1370,7 @@ static void print_bug_trap(struct pt_regs *regs) ...@@ -1370,7 +1370,7 @@ static void print_bug_trap(struct pt_regs *regs)
#endif #endif
} }
void excprint(struct pt_regs *fp) static void excprint(struct pt_regs *fp)
{ {
unsigned long trap; unsigned long trap;
...@@ -1408,7 +1408,7 @@ void excprint(struct pt_regs *fp) ...@@ -1408,7 +1408,7 @@ void excprint(struct pt_regs *fp)
print_bug_trap(fp); print_bug_trap(fp);
} }
void prregs(struct pt_regs *fp) static void prregs(struct pt_regs *fp)
{ {
int n, trap; int n, trap;
unsigned long base; unsigned long base;
...@@ -1463,7 +1463,7 @@ void prregs(struct pt_regs *fp) ...@@ -1463,7 +1463,7 @@ void prregs(struct pt_regs *fp)
printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr);
} }
void cacheflush(void) static void cacheflush(void)
{ {
int cmd; int cmd;
unsigned long nflush; unsigned long nflush;
...@@ -1495,7 +1495,7 @@ void cacheflush(void) ...@@ -1495,7 +1495,7 @@ void cacheflush(void)
catch_memory_errors = 0; catch_memory_errors = 0;
} }
unsigned long static unsigned long
read_spr(int n) read_spr(int n)
{ {
unsigned int instrs[2]; unsigned int instrs[2];
...@@ -1533,7 +1533,7 @@ read_spr(int n) ...@@ -1533,7 +1533,7 @@ read_spr(int n)
return ret; return ret;
} }
void static void
write_spr(int n, unsigned long val) write_spr(int n, unsigned long val)
{ {
unsigned int instrs[2]; unsigned int instrs[2];
...@@ -1571,7 +1571,7 @@ static unsigned long regno; ...@@ -1571,7 +1571,7 @@ static unsigned long regno;
extern char exc_prolog; extern char exc_prolog;
extern char dec_exc; extern char dec_exc;
void super_regs(void) static void super_regs(void)
{ {
int cmd; int cmd;
unsigned long val; unsigned long val;
...@@ -1629,7 +1629,7 @@ void super_regs(void) ...@@ -1629,7 +1629,7 @@ void super_regs(void)
/* /*
* Stuff for reading and writing memory safely * Stuff for reading and writing memory safely
*/ */
int static int
mread(unsigned long adrs, void *buf, int size) mread(unsigned long adrs, void *buf, int size)
{ {
volatile int n; volatile int n;
...@@ -1666,7 +1666,7 @@ mread(unsigned long adrs, void *buf, int size) ...@@ -1666,7 +1666,7 @@ mread(unsigned long adrs, void *buf, int size)
return n; return n;
} }
int static int
mwrite(unsigned long adrs, void *buf, int size) mwrite(unsigned long adrs, void *buf, int size)
{ {
volatile int n; volatile int n;
...@@ -1731,7 +1731,7 @@ static int handle_fault(struct pt_regs *regs) ...@@ -1731,7 +1731,7 @@ static int handle_fault(struct pt_regs *regs)
#define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t)) #define SWAP(a, b, t) ((t) = (a), (a) = (b), (b) = (t))
void static void
byterev(unsigned char *val, int size) byterev(unsigned char *val, int size)
{ {
int t; int t;
...@@ -1793,7 +1793,7 @@ static char *memex_subcmd_help_string = ...@@ -1793,7 +1793,7 @@ static char *memex_subcmd_help_string =
" x exit this mode\n" " x exit this mode\n"
""; "";
void static void
memex(void) memex(void)
{ {
int cmd, inc, i, nslash; int cmd, inc, i, nslash;
...@@ -1944,7 +1944,7 @@ memex(void) ...@@ -1944,7 +1944,7 @@ memex(void)
} }
} }
int static int
bsesc(void) bsesc(void)
{ {
int c; int c;
...@@ -1984,7 +1984,7 @@ static void xmon_rawdump (unsigned long adrs, long ndump) ...@@ -1984,7 +1984,7 @@ static void xmon_rawdump (unsigned long adrs, long ndump)
#define isxdigit(c) (('0' <= (c) && (c) <= '9') \ #define isxdigit(c) (('0' <= (c) && (c) <= '9') \
|| ('a' <= (c) && (c) <= 'f') \ || ('a' <= (c) && (c) <= 'f') \
|| ('A' <= (c) && (c) <= 'F')) || ('A' <= (c) && (c) <= 'F'))
void static void
dump(void) dump(void)
{ {
int c; int c;
...@@ -2022,7 +2022,7 @@ dump(void) ...@@ -2022,7 +2022,7 @@ dump(void)
} }
} }
void static void
prdump(unsigned long adrs, long ndump) prdump(unsigned long adrs, long ndump)
{ {
long n, m, c, r, nr; long n, m, c, r, nr;
...@@ -2066,7 +2066,7 @@ prdump(unsigned long adrs, long ndump) ...@@ -2066,7 +2066,7 @@ prdump(unsigned long adrs, long ndump)
typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr); typedef int (*instruction_dump_func)(unsigned long inst, unsigned long addr);
int static int
generic_inst_dump(unsigned long adr, long count, int praddr, generic_inst_dump(unsigned long adr, long count, int praddr,
instruction_dump_func dump_func) instruction_dump_func dump_func)
{ {
...@@ -2104,7 +2104,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr, ...@@ -2104,7 +2104,7 @@ generic_inst_dump(unsigned long adr, long count, int praddr,
return adr - first_adr; return adr - first_adr;
} }
int static int
ppc_inst_dump(unsigned long adr, long count, int praddr) ppc_inst_dump(unsigned long adr, long count, int praddr)
{ {
return generic_inst_dump(adr, count, praddr, print_insn_powerpc); 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,7 +2126,7 @@ static unsigned long mval; /* byte value to set memory to */
static unsigned long mcount; /* # bytes to affect */ static unsigned long mcount; /* # bytes to affect */
static unsigned long mdiffs; /* max # differences to print */ static unsigned long mdiffs; /* max # differences to print */
void static void
memops(int cmd) memops(int cmd)
{ {
scanhex((void *)&mdest); scanhex((void *)&mdest);
...@@ -2152,7 +2152,7 @@ memops(int cmd) ...@@ -2152,7 +2152,7 @@ memops(int cmd)
} }
} }
void static void
memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr) memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
{ {
unsigned n, prt; unsigned n, prt;
...@@ -2170,7 +2170,7 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr) ...@@ -2170,7 +2170,7 @@ memdiffs(unsigned char *p1, unsigned char *p2, unsigned nb, unsigned maxpr)
static unsigned mend; static unsigned mend;
static unsigned mask; static unsigned mask;
void static void
memlocate(void) memlocate(void)
{ {
unsigned a, n; unsigned a, n;
...@@ -2203,7 +2203,7 @@ memlocate(void) ...@@ -2203,7 +2203,7 @@ memlocate(void)
static unsigned long mskip = 0x1000; static unsigned long mskip = 0x1000;
static unsigned long mlim = 0xffffffff; static unsigned long mlim = 0xffffffff;
void static void
memzcan(void) memzcan(void)
{ {
unsigned char v; unsigned char v;
...@@ -2230,7 +2230,7 @@ memzcan(void) ...@@ -2230,7 +2230,7 @@ memzcan(void)
printf("%.8x\n", a - mskip); printf("%.8x\n", a - mskip);
} }
void proccall(void) static void proccall(void)
{ {
unsigned long args[8]; unsigned long args[8];
unsigned long ret; unsigned long ret;
...@@ -2388,7 +2388,7 @@ scanhex(unsigned long *vp) ...@@ -2388,7 +2388,7 @@ scanhex(unsigned long *vp)
return 1; return 1;
} }
void static void
scannl(void) scannl(void)
{ {
int c; int c;
...@@ -2399,7 +2399,7 @@ scannl(void) ...@@ -2399,7 +2399,7 @@ scannl(void)
c = inchar(); c = inchar();
} }
int hexdigit(int c) static int hexdigit(int c)
{ {
if( '0' <= c && c <= '9' ) if( '0' <= c && c <= '9' )
return c - '0'; return c - '0';
...@@ -2430,13 +2430,13 @@ getstring(char *s, int size) ...@@ -2430,13 +2430,13 @@ getstring(char *s, int size)
static char line[256]; static char line[256];
static char *lineptr; static char *lineptr;
void static void
flush_input(void) flush_input(void)
{ {
lineptr = NULL; lineptr = NULL;
} }
int static int
inchar(void) inchar(void)
{ {
if (lineptr == NULL || *lineptr == 0) { if (lineptr == NULL || *lineptr == 0) {
...@@ -2449,7 +2449,7 @@ inchar(void) ...@@ -2449,7 +2449,7 @@ inchar(void)
return *lineptr++; return *lineptr++;
} }
void static void
take_input(char *str) take_input(char *str)
{ {
lineptr = str; lineptr = str;
...@@ -2618,7 +2618,8 @@ static void dump_tlb_44x(void) ...@@ -2618,7 +2618,8 @@ static void dump_tlb_44x(void)
} }
} }
#endif /* CONFIG_44x */ #endif /* CONFIG_44x */
void xmon_init(int enable)
static void xmon_init(int enable)
{ {
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES)) if (firmware_has_feature(FW_FEATURE_ISERIES))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment