lkml.org 
[lkml]   [2010]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/11] drivers: isdn: use new hex_to_bin() method
Am 22.02.2010 19:09 schrieb Andy Shevchenko:
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
>
> Get rid of own implementation of hex_to_bin().
>
> Please note it requires to have hex_to_bin() introduced by one of previous
> patch [1] which is not applied yet.
>
> [1] http://patchwork.kernel.org/patch/80404/
>
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> Cc: Tilman Schmidt <tilman@imap.cc>

Acked-by: Tilman Schmidt <tilman@imap.cc>

> ---
> drivers/isdn/gigaset/capi.c | 13 +------------
> 1 files changed, 1 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
> index 3f5cd06..532ca33 100644
> --- a/drivers/isdn/gigaset/capi.c
> +++ b/drivers/isdn/gigaset/capi.c
> @@ -183,17 +183,6 @@ static inline int ishexdigit(char c)
> }
>
> /*
> - * convert hex to binary
> - */
> -static inline u8 hex2bin(char c)
> -{
> - int result = c & 0x0f;
> - if (c & 0x40)
> - result += 9;
> - return result;
> -}
> -
> -/*
> * convert an IE from Gigaset hex string to ETSI binary representation
> * including length byte
> * return value: result length, -1 on error
> @@ -204,7 +193,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
> while (*in) {
> if (!ishexdigit(in[0]) || !ishexdigit(in[1]) || l >= maxlen)
> return -1;
> - out[++l] = (hex2bin(in[0]) << 4) + hex2bin(in[1]);
> + out[++l] = (hex_to_bin(in[0]) << 4) + hex_to_bin(in[1]);
> in += 2;
> }
> out[0] = l;

--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2010-02-22 22:27    [from the cache]
©2003-2011 Jasper Spaans