drivers: isdn: use new hex_to_bin() method

Previous thread: scripts/get_maintainer.pl: optionally ignore non-maintainer signatures by Linux Kernel Mailing List on Tuesday, May 25, 2010 - 8:59 am. (1 message)

Next thread: checkpatch: add check for too short Kconfig descriptions by Linux Kernel Mailing List on Tuesday, May 25, 2010 - 9:00 am. (1 message)
From: Linux Kernel Mailing List
Date: Tuesday, May 25, 2010 - 9:00 am

Gitweb:     http://git.kernel.org/linus/0496b55c56d0be80e27f417f66690d97e5370f86
Commit:     0496b55c56d0be80e27f417f66690d97e5370f86
Parent:     903788892ea0fc7fcaf7e8e5fac9a77379fc215b
Author:     Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
AuthorDate: Mon May 24 14:33:25 2010 -0700
Committer:  Linus Torvalds <torvalds@linux-foundation.org>
CommitDate: Tue May 25 08:07:05 2010 -0700

    drivers: isdn: use new hex_to_bin() method
    
    Remove own implementation of hex_to_bin().
    
    Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
    Acked-by: Tilman Schmidt <tilman@imap.cc>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 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 964a55f..ac4cfee 100644
--- a/drivers/isdn/gigaset/capi.c
+++ b/drivers/isdn/gigaset/capi.c
@@ -170,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
@@ -191,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;
--

Previous thread: scripts/get_maintainer.pl: optionally ignore non-maintainer signatures by Linux Kernel Mailing List on Tuesday, May 25, 2010 - 8:59 am. (1 message)

Next thread: checkpatch: add check for too short Kconfig descriptions by Linux Kernel Mailing List on Tuesday, May 25, 2010 - 9:00 am. (1 message)