xmon sparse cleanups
Andrew, please apply:
This patch removes many sparse warnings from the xmon code. Mostly K&R function declarations and 0-instead-of-NULLs.
I believe this removes all save one sparse error in xmon, excepting those inherited from header files.
arch/ppc64/xmon/xmon.c +13 -15
@@ -645,7 +645,7 @@for (i =0 ; i <NBPTS ; ++i, ++bp)if (bp->enabled && pc == bp->address)return bp; -return 0 ; +return NULL ; }static struct bpt *in_breakpoint_table (unsigned long nip,unsigned long *offp)
@@ -1582,7 +1582,7 @@extern char dec_exc;void -super_regs () +super_regs (void ) {int cmd;unsigned long val;
@@ -1816,7 +1816,7 @@"" ;void -memex () +memex (void ) {int cmd, inc, i, nslash;unsigned long n;
@@ -1967,7 +1967,7 @@ }int -bsesc () +bsesc (void ) {int c;
@@ -1985,7 +1985,7 @@ || ('a' <= (c) && (c) <= 'f') \ || ('A' <= (c) && (c) <= 'F'))void -dump () +dump (void ) {int c;
@@ -2150,7 +2150,7 @@static unsigned mask;void -memlocate () +memlocate (void ) {unsigned a, n;unsigned char val[4 ];
@@ -2183,7 +2183,7 @@static unsigned long mlim =0xffffffff ;void -memzcan () +memzcan (void ) {unsigned char v;unsigned a;
@@ -2212,7 +2212,7 @@/* Input scanning routines */ int -skipbl () +skipbl (void ) {int c;
@@ -2237,8 +2237,7 @@ };int -scanhex (vp) -unsigned long *vp; +scanhex (unsigned long *vp) {int c, d;unsigned long v;
@@ -2322,7 +2321,7 @@ }void -scannl () +scannl (void ) {int c;
@@ -2365,13 +2364,13 @@static char *lineptr;void -flush_input () +flush_input (void ) { lineptr =NULL ; }int -inchar () +inchar (void ) {if (lineptr ==NULL || *lineptr ==0 ) {if (fgets (line,sizeof (line), stdin) ==NULL ) {
@@ -2384,8 +2383,7 @@ }void -take_input (str) -char *str; +take_input (char *str) { lineptr = str; }
arch/ppc64/xmon/ppc-opc.c +60 -59
380 lines not on this page · raw message
arch/ppc64/xmon/start.c +1 -1
@@ -173,7 +173,7 @@ c =xmon_getchar ();if (c ==-1 ) {if (p == str) -return 0 ; +return NULL ;break ; } *p++ = c;
Signature · 4 lines
David Gibson | For every complex problem there is a david AT gibson.dropbear.id.au | solution which is simple, neat and | wrong. http://www.ozlabs.org/people/dgibson
Quoted 4 lines · David Gibson
Andrew, please apply:
This patch removes many sparse warnings from the xmon code. Mostly K&R function declarations and 0-instead-of-NULLs.
The trouble with this patch is that it makes ppc-opc.c diverge from the version in binutils, which is where it came from. I'd rather keep it as close as possible to that version. I have no problem with the changes to the other files.
Paul.
Quoted 11 lines · Paul Mackerras
Quoted 4 lines · David Gibson
Andrew, please apply:
This patch removes many sparse warnings from the xmon code. Mostly K&R function declarations and 0-instead-of-NULLs.
The trouble with this patch is that it makes
ppc-opc.cdiverge from the version in binutils, which is where it came from. I'd rather keep it as close as possible to that version. I have no problem with the changes to the other files.
A corresponding patch has now gone into binutils CVS. As it happens there has already been a certain amount of divergence between the versions, presumably because the kernel copy hasn't been updated from binutils in quite a while.
Signature · 4 lines
David Gibson | For every complex problem there is a david AT gibson.dropbear.id.au | solution which is simple, neat and | wrong. http://www.ozlabs.org/people/dgibson