[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B7DD363.4050402@imap.cc>
Date: Fri, 19 Feb 2010 00:55:15 +0100
From: Tilman Schmidt <tilman@...p.cc>
To: Andy Shevchenko <andy.shevchenko@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
Subject: Re: [PATCH 11/12] drivers: isdn: use new hex_to_bin() method
Am 18.02.2010 19:55 schrieb Andy Shevchenko:
> From: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
>
> Get rid of own implementation of hex_to_bin(). It requires to have hex_to_bin()
> introduced by one of previous path in series.
>
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@...ia.com>
> ---
> drivers/isdn/gigaset/capi.c | 14 ++------------
> 1 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c
> index 83c4e2f..72adcfb 100644
> --- a/drivers/isdn/gigaset/capi.c
> +++ b/drivers/isdn/gigaset/capi.c
> @@ -13,6 +13,7 @@
>
> #include "gigaset.h"
> #include <linux/ctype.h>
> +#include <linux/kernel.h>
> #include <linux/isdn/capilli.h>
> #include <linux/isdn/capicmd.h>
> #include <linux/isdn/capiutil.h>
You don't need to include kernel.h here, it's already included
from gigaset.h.
> @@ -169,17 +170,6 @@ static inline void ignore_cstruct_param(struct cardstate *cs, _cstruct param,
> }
>
> /*
> - * 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
> @@ -190,7 +180,7 @@ static int encode_ie(char *in, u8 *out, int maxlen)
> while (*in) {
> if (!isxdigit(in[0]) || !isxdigit(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;
Otherwise, fine with me.
Thanks,
Tilman
--
Tilman Schmidt E-Mail: tilman@...p.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)
Download attachment "signature.asc" of type "application/pgp-signature" (260 bytes)
Powered by blists - more mailing lists