Commit 3ff16c25 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

Staging: don't use custom hex_to_bin() implementation

Signed-off-by: default avatarAndy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 600cec3e
...@@ -48,6 +48,7 @@ Devices: [JR3] PCI force sensor board (jr3_pci) ...@@ -48,6 +48,7 @@ Devices: [JR3] PCI force sensor board (jr3_pci)
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/kernel.h>
#include "comedi_pci.h" #include "comedi_pci.h"
#include "jr3_pci.h" #include "jr3_pci.h"
...@@ -397,14 +398,14 @@ int read_idm_word(const u8 * data, size_t size, int *pos, unsigned int *val) ...@@ -397,14 +398,14 @@ int read_idm_word(const u8 * data, size_t size, int *pos, unsigned int *val)
} }
/* Collect value */ /* Collect value */
*val = 0; *val = 0;
for (; *pos < size && isxdigit(data[*pos]); (*pos)++) { for (; *pos < size; (*pos)++) {
char ch = tolower(data[*pos]); int value;
result = 1; value = hex_to_bin(data[*pos]);
if ('0' <= ch && ch <= '9') { if (value >= 0) {
*val = (*val << 4) + (ch - '0'); result = 1;
} else if ('a' <= ch && ch <= 'f') { *val = (*val << 4) + value;
*val = (*val << 4) + (ch - 'a' + 10); } else
} break;
} }
} }
return result; return result;
......
...@@ -1848,22 +1848,6 @@ bool IsHexDigit( char chTmp) ...@@ -1848,22 +1848,6 @@ bool IsHexDigit( char chTmp)
} }
} }
//
// Description:
// Translate a character to hex digit.
//
u32 MapCharToHexDigit(char chTmp)
{
if(chTmp >= '0' && chTmp <= '9')
return (chTmp - '0');
else if(chTmp >= 'a' && chTmp <= 'f')
return (10 + (chTmp - 'a'));
else if(chTmp >= 'A' && chTmp <= 'F')
return (10 + (chTmp - 'A'));
else
return 0;
}
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
* Function: efuse_ParsingMap * Function: efuse_ParsingMap
* *
...@@ -1917,8 +1901,7 @@ efuse_ParsingMap(char* szStr,u32* pu4bVal,u32* pu4bMove) ...@@ -1917,8 +1901,7 @@ efuse_ParsingMap(char* szStr,u32* pu4bVal,u32* pu4bMove)
// Parse each digit. // Parse each digit.
do do
{ {
(*pu4bVal) <<= 4; *pu4bVal = (*pu4bVal << 4) + hex_to_bin(*szScan);
*pu4bVal += MapCharToHexDigit(*szScan);
szScan++; szScan++;
(*pu4bMove)++; (*pu4bMove)++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment