target: remove custom hex2bin() implementation

This patch drops transport_asciihex_to_binaryhex() in favor of proper
hex2bin usage from include/linux/kernel.h:hex2bin()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
Andy Shevchenko
2011-07-18 22:26:40 -07:00
committed by Nicholas Bellinger
parent 163cd5fa9f
commit 11650b8596
4 changed files with 11 additions and 51 deletions
+7 -10
View File
@@ -25,6 +25,7 @@
*
******************************************************************************/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/spinlock.h>
@@ -61,9 +62,8 @@ u32 sas_get_pr_transport_id(
int *format_code,
unsigned char *buf)
{
unsigned char binary, *ptr;
int i;
u32 off = 4;
unsigned char *ptr;
/*
* Set PROTOCOL IDENTIFIER to 6h for SAS
*/
@@ -74,10 +74,8 @@ u32 sas_get_pr_transport_id(
*/
ptr = &se_nacl->initiatorname[4]; /* Skip over 'naa. prefix */
for (i = 0; i < 16; i += 2) {
binary = transport_asciihex_to_binaryhex(&ptr[i]);
buf[off++] = binary;
}
hex2bin(&buf[4], ptr, 8);
/*
* The SAS Transport ID is a hardcoded 24-byte length
*/
@@ -157,7 +155,7 @@ u32 fc_get_pr_transport_id(
int *format_code,
unsigned char *buf)
{
unsigned char binary, *ptr;
unsigned char *ptr;
int i;
u32 off = 8;
/*
@@ -176,8 +174,7 @@ u32 fc_get_pr_transport_id(
i++;
continue;
}
binary = transport_asciihex_to_binaryhex(&ptr[i]);
buf[off++] = binary;
hex2bin(&buf[off++], &ptr[i], 1);
i += 2;
}
/*