Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] Removal of warning messages for gdb-stub.c
@ 2002-02-08 15:33 Steven J. Hill
  2002-02-08 16:16 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Steven J. Hill @ 2002-02-08 15:33 UTC (permalink / raw)
  To: linux-mips

Just more clean ups. I tested it, it works.

-Steve

diff -urN -X cvs-exc.txt mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c settop/arch/mips/kernel/gdb-stub.c
--- mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c	Thu Nov 29 09:13:08 2001
+++ settop/arch/mips/kernel/gdb-stub.c	Fri Feb  8 09:14:52 2002
@@ -306,7 +306,7 @@
 	unsigned char ch;
 
 	while (count-- > 0) {
-		if (kgdb_read_byte(mem++, &ch) != 0)
+		if (kgdb_read_byte((unsigned *) mem++, (unsigned *) &ch) != 0)
 			return 0;
 		*buf++ = hexchars[ch >> 4];
 		*buf++ = hexchars[ch & 0xf];
@@ -332,7 +332,7 @@
 	{
 		ch = hex(*buf++) << 4;
 		ch |= hex(*buf++);
-		if (kgdb_write_byte(ch, mem++) != 0)
+		if (kgdb_write_byte((unsigned) ch, (unsigned *) mem++) != 0)
 			return 0;
 	}
 
@@ -902,23 +902,21 @@
 	if (!initialized)
 		return;
 
-	__asm__ __volatile__("
-			.globl	breakinst
-			.set	noreorder
-			nop
-breakinst:		break
-			nop
-			.set	reorder
-	");
+	__asm__ __volatile__(
+		".globl\tbreakinst\n\t"
+		".set\tnoreorder\n\t"
+		"nop\n\t"
+		"breakinst:\tbreak\n\t"
+		"nop\n\t"
+		".set\treorder\n\t");
 }
 
 void adel(void)
 {
-	__asm__ __volatile__("
-			.globl	adel
-			la	$8,0x80000001
-			lw	$9,0($8)
-	");
+	__asm__ __volatile__(
+		".globl\tadel\n\t"
+		"la\t$8,0x80000001\n\t"
+		"lw\t$9,0($8)\n\t");
 }
 
 #ifdef CONFIG_GDB_CONSOLE

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Removal of warning messages for gdb-stub.c
  2002-02-08 15:33 [PATCH] Removal of warning messages for gdb-stub.c Steven J. Hill
@ 2002-02-08 16:16 ` Geert Uytterhoeven
  2002-02-08 17:42   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2002-02-08 16:16 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: Linux/MIPS Development

On Fri, 8 Feb 2002, Steven J. Hill wrote:
> Just more clean ups. I tested it, it works.
> 
> -Steve
> 
> diff -urN -X cvs-exc.txt mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c settop/arch/mips/kernel/gdb-stub.c
> --- mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c	Thu Nov 29 09:13:08 2001
> +++ settop/arch/mips/kernel/gdb-stub.c	Fri Feb  8 09:14:52 2002
> @@ -306,7 +306,7 @@
>  	unsigned char ch;
>  
>  	while (count-- > 0) {
> -		if (kgdb_read_byte(mem++, &ch) != 0)
> +		if (kgdb_read_byte((unsigned *) mem++, (unsigned *) &ch) != 0)
>  			return 0;
>  		*buf++ = hexchars[ch >> 4];
>  		*buf++ = hexchars[ch & 0xf];
> @@ -332,7 +332,7 @@
>  	{
>  		ch = hex(*buf++) << 4;
>  		ch |= hex(*buf++);
> -		if (kgdb_write_byte(ch, mem++) != 0)
> +		if (kgdb_write_byte((unsigned) ch, (unsigned *) mem++) != 0)
>  			return 0;
>  	}
>  

Wouldn't it be better to change the prototypes

| int kgdb_read_byte(unsigned *address, unsigned *dest);
| int kgdb_write_byte(unsigned val, unsigned *dest);

instead?

If these routines work on bytes, why have them taking unsigned (wasn't plain
`unsigned' deprecated in some recent C standard?) parameters instead of char
parameters?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Removal of warning messages for gdb-stub.c
  2002-02-08 16:16 ` Geert Uytterhoeven
@ 2002-02-08 17:42   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2002-02-08 17:42 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Steven J. Hill, Linux/MIPS Development

On Fri, Feb 08, 2002 at 05:16:00PM +0100, Geert Uytterhoeven wrote:
> On Fri, 8 Feb 2002, Steven J. Hill wrote:
> > Just more clean ups. I tested it, it works.
> > 
> > -Steve
> > 
> > diff -urN -X cvs-exc.txt mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c settop/arch/mips/kernel/gdb-stub.c
> > --- mipslinux-2.4.17-xfs/arch/mips/kernel/gdb-stub.c	Thu Nov 29 09:13:08 2001
> > +++ settop/arch/mips/kernel/gdb-stub.c	Fri Feb  8 09:14:52 2002
> > @@ -306,7 +306,7 @@
> >  	unsigned char ch;
> >  
> >  	while (count-- > 0) {
> > -		if (kgdb_read_byte(mem++, &ch) != 0)
> > +		if (kgdb_read_byte((unsigned *) mem++, (unsigned *) &ch) != 0)
> >  			return 0;
> >  		*buf++ = hexchars[ch >> 4];
> >  		*buf++ = hexchars[ch & 0xf];
> > @@ -332,7 +332,7 @@
> >  	{
> >  		ch = hex(*buf++) << 4;
> >  		ch |= hex(*buf++);
> > -		if (kgdb_write_byte(ch, mem++) != 0)
> > +		if (kgdb_write_byte((unsigned) ch, (unsigned *) mem++) != 0)
> >  			return 0;
> >  	}
> >  
> 
> Wouldn't it be better to change the prototypes
> 
> | int kgdb_read_byte(unsigned *address, unsigned *dest);
> | int kgdb_write_byte(unsigned val, unsigned *dest);
> 
> instead?
> 
> If these routines work on bytes, why have them taking unsigned (wasn't plain
> `unsigned' deprecated in some recent C standard?) parameters instead of char
> parameters?

Because Ralf dropped one of my patches, or messed up a merge, or more
likely I simply sent him a bad patch.  My working directory from when I
remember writing those functions says unsigned char...

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-08 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-08 15:33 [PATCH] Removal of warning messages for gdb-stub.c Steven J. Hill
2002-02-08 16:16 ` Geert Uytterhoeven
2002-02-08 17:42   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox