diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2011-07-19 01:26:40 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 05:37:49 -0400 |
commit | 11650b859681e03fdbf26277fcfc5f1f62186703 (patch) | |
tree | 1073305aa356589d05cf59c70dae748c4c0e8b75 /drivers/target/target_core_cdb.c | |
parent | 163cd5fa9fcb7ccc73a9e39d5f601cfd41a23bfa (diff) |
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>
Diffstat (limited to 'drivers/target/target_core_cdb.c')
-rw-r--r-- | drivers/target/target_core_cdb.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c index 27e6a2e5e84a..8ae09a1bdf74 100644 --- a/drivers/target/target_core_cdb.c +++ b/drivers/target/target_core_cdb.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/kernel.h> | ||
26 | #include <asm/unaligned.h> | 27 | #include <asm/unaligned.h> |
27 | #include <scsi/scsi.h> | 28 | #include <scsi/scsi.h> |
28 | 29 | ||
@@ -162,11 +163,9 @@ target_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf) | |||
162 | struct t10_alua_lu_gp_member *lu_gp_mem; | 163 | struct t10_alua_lu_gp_member *lu_gp_mem; |
163 | struct t10_alua_tg_pt_gp *tg_pt_gp; | 164 | struct t10_alua_tg_pt_gp *tg_pt_gp; |
164 | struct t10_alua_tg_pt_gp_member *tg_pt_gp_mem; | 165 | struct t10_alua_tg_pt_gp_member *tg_pt_gp_mem; |
165 | unsigned char binary, binary_new; | ||
166 | unsigned char *prod = &dev->se_sub_dev->t10_wwn.model[0]; | 166 | unsigned char *prod = &dev->se_sub_dev->t10_wwn.model[0]; |
167 | u32 prod_len; | 167 | u32 prod_len; |
168 | u32 unit_serial_len, off = 0; | 168 | u32 unit_serial_len, off = 0; |
169 | int i; | ||
170 | u16 len = 0, id_len; | 169 | u16 len = 0, id_len; |
171 | 170 | ||
172 | off = 4; | 171 | off = 4; |
@@ -215,16 +214,9 @@ target_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf) | |||
215 | * VENDOR_SPECIFIC_IDENTIFIER and | 214 | * VENDOR_SPECIFIC_IDENTIFIER and |
216 | * VENDOR_SPECIFIC_IDENTIFIER_EXTENTION | 215 | * VENDOR_SPECIFIC_IDENTIFIER_EXTENTION |
217 | */ | 216 | */ |
218 | binary = transport_asciihex_to_binaryhex( | 217 | buf[off++] |= hex_to_bin(dev->se_sub_dev->t10_wwn.unit_serial[0]); |
219 | &dev->se_sub_dev->t10_wwn.unit_serial[0]); | 218 | hex2bin(&buf[off], &dev->se_sub_dev->t10_wwn.unit_serial[1], 12); |
220 | buf[off++] |= (binary & 0xf0) >> 4; | 219 | |
221 | for (i = 0; i < 24; i += 2) { | ||
222 | binary_new = transport_asciihex_to_binaryhex( | ||
223 | &dev->se_sub_dev->t10_wwn.unit_serial[i+2]); | ||
224 | buf[off] = (binary & 0x0f) << 4; | ||
225 | buf[off++] |= (binary_new & 0xf0) >> 4; | ||
226 | binary = binary_new; | ||
227 | } | ||
228 | len = 20; | 220 | len = 20; |
229 | off = (len + 4); | 221 | off = (len + 4); |
230 | 222 | ||