lkml.org 
[lkml]   [2013]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] cris: kgdb: use native hex2bin
From
On Tue, May 28, 2013 at 5:53 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> diff --git a/arch/cris/arch-v10/kernel/kgdb.c b/arch/cris/arch-v10/kernel/kgdb.c
> index 37e6d2c..07bccd8 100644
> --- a/arch/cris/arch-v10/kernel/kgdb.c
> +++ b/arch/cris/arch-v10/kernel/kgdb.c

> @@ -659,18 +651,6 @@ read_register (char regno, unsigned int *valptr)
> }
>
> /********************************** Packet I/O ******************************/
> -/* Returns the integer equivalent of a hexadecimal character. */
> -static int
> -hex (char ch)
> -{
> - if ((ch >= 'a') && (ch <= 'f'))
> - return (ch - 'a' + 10);
> - if ((ch >= '0') && (ch <= '9'))
> - return (ch - '0');
> - if ((ch >= 'A') && (ch <= 'F'))
> - return (ch - 'A' + 10);
> - return (-1);
> -}

This one handles both upper and lower case hex characters, while hex2bin()
handles lower case only. Is that OK, or should hex2bin be extended?

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


\
 
 \ /
  Last update: 2013-05-30 10:41    [W:0.096 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site