linux-mips
[Top] [All Lists]

Re: [PATCH] Removal of warning messages for gdb-stub.c

To: "Steven J. Hill" <sjhill@realitydiluted.com>
Subject: Re: [PATCH] Removal of warning messages for gdb-stub.c
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Fri, 8 Feb 2002 17:16:00 +0100 (MET)
Cc: Linux/MIPS Development <linux-mips@oss.sgi.com>
In-reply-to: <E16ZD2B-0003iv-00@real.realitydiluted.com>
Sender: owner-linux-mips@oss.sgi.com
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


<Prev in Thread] Current Thread [Next in Thread>