Commit ffddc0d0 authored by David Gibson's avatar David Gibson Committed by Linus Torvalds

[PATCH] ppc64: xmon sparse cleanups

This patch removes many sparse warnings from the xmon code.  Mostly K&R
function declarations and 0-instead-of-NULLs.  There are still a whole
bunch of warnings in xmon/ppc-opc.c, which is a copy of a file from
binutils.
Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9da1f558
...@@ -173,7 +173,7 @@ xmon_fgets(char *str, int nb, void *f) ...@@ -173,7 +173,7 @@ xmon_fgets(char *str, int nb, void *f)
c = xmon_getchar(); c = xmon_getchar();
if (c == -1) { if (c == -1) {
if (p == str) if (p == str)
return 0; return NULL;
break; break;
} }
*p++ = c; *p++ = c;
......
...@@ -645,7 +645,7 @@ static struct bpt *at_breakpoint(unsigned long pc) ...@@ -645,7 +645,7 @@ static struct bpt *at_breakpoint(unsigned long pc)
for (i = 0; i < NBPTS; ++i, ++bp) for (i = 0; i < NBPTS; ++i, ++bp)
if (bp->enabled && pc == bp->address) if (bp->enabled && pc == bp->address)
return bp; return bp;
return 0; return NULL;
} }
static struct bpt *in_breakpoint_table(unsigned long nip, unsigned long *offp) static struct bpt *in_breakpoint_table(unsigned long nip, unsigned long *offp)
...@@ -1582,7 +1582,7 @@ extern char exc_prolog; ...@@ -1582,7 +1582,7 @@ extern char exc_prolog;
extern char dec_exc; extern char dec_exc;
void void
super_regs() super_regs(void)
{ {
int cmd; int cmd;
unsigned long val; unsigned long val;
...@@ -1816,7 +1816,7 @@ static char *memex_subcmd_help_string = ...@@ -1816,7 +1816,7 @@ static char *memex_subcmd_help_string =
""; "";
void void
memex() memex(void)
{ {
int cmd, inc, i, nslash; int cmd, inc, i, nslash;
unsigned long n; unsigned long n;
...@@ -1967,7 +1967,7 @@ memex() ...@@ -1967,7 +1967,7 @@ memex()
} }
int int
bsesc() bsesc(void)
{ {
int c; int c;
...@@ -1985,7 +1985,7 @@ bsesc() ...@@ -1985,7 +1985,7 @@ bsesc()
|| ('a' <= (c) && (c) <= 'f') \ || ('a' <= (c) && (c) <= 'f') \
|| ('A' <= (c) && (c) <= 'F')) || ('A' <= (c) && (c) <= 'F'))
void void
dump() dump(void)
{ {
int c; int c;
...@@ -2150,7 +2150,7 @@ static unsigned mend; ...@@ -2150,7 +2150,7 @@ static unsigned mend;
static unsigned mask; static unsigned mask;
void void
memlocate() memlocate(void)
{ {
unsigned a, n; unsigned a, n;
unsigned char val[4]; unsigned char val[4];
...@@ -2183,7 +2183,7 @@ static unsigned long mskip = 0x1000; ...@@ -2183,7 +2183,7 @@ static unsigned long mskip = 0x1000;
static unsigned long mlim = 0xffffffff; static unsigned long mlim = 0xffffffff;
void void
memzcan() memzcan(void)
{ {
unsigned char v; unsigned char v;
unsigned a; unsigned a;
...@@ -2212,7 +2212,7 @@ memzcan() ...@@ -2212,7 +2212,7 @@ memzcan()
/* Input scanning routines */ /* Input scanning routines */
int int
skipbl() skipbl(void)
{ {
int c; int c;
...@@ -2237,8 +2237,7 @@ static char *regnames[N_PTREGS] = { ...@@ -2237,8 +2237,7 @@ static char *regnames[N_PTREGS] = {
}; };
int int
scanhex(vp) scanhex(unsigned long *vp)
unsigned long *vp;
{ {
int c, d; int c, d;
unsigned long v; unsigned long v;
...@@ -2322,7 +2321,7 @@ unsigned long *vp; ...@@ -2322,7 +2321,7 @@ unsigned long *vp;
} }
void void
scannl() scannl(void)
{ {
int c; int c;
...@@ -2365,13 +2364,13 @@ static char line[256]; ...@@ -2365,13 +2364,13 @@ static char line[256];
static char *lineptr; static char *lineptr;
void void
flush_input() flush_input(void)
{ {
lineptr = NULL; lineptr = NULL;
} }
int int
inchar() inchar(void)
{ {
if (lineptr == NULL || *lineptr == 0) { if (lineptr == NULL || *lineptr == 0) {
if (fgets(line, sizeof(line), stdin) == NULL) { if (fgets(line, sizeof(line), stdin) == NULL) {
...@@ -2384,8 +2383,7 @@ inchar() ...@@ -2384,8 +2383,7 @@ inchar()
} }
void void
take_input(str) take_input(char *str)
char *str;
{ {
lineptr = str; lineptr = str;
} }
......
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