Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264674
b: refs/heads/master
c: b6b4e61
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and Nicholas Bellinger committed Oct 24, 2011
1 parent 1b0535d commit 5c3ce8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 39c05f321a4b27f3036392eed68bd94ce2267155
refs/heads/master: b6b4e61ff4e26d6721b2607ea23402825a38c402
29 changes: 14 additions & 15 deletions trunk/drivers/target/target_core_cdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/

#include <linux/kernel.h>
#include <linux/ctype.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>

Expand Down Expand Up @@ -156,11 +155,12 @@ target_emulate_evpd_80(struct se_cmd *cmd, unsigned char *buf)
}

static void
target_parse_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf_off)
target_parse_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf)
{
unsigned char *p = &dev->se_sub_dev->t10_wwn.unit_serial[0];
unsigned char *buf = buf_off;
int cnt = 0, next = 1;
int cnt;
bool next = true;

/*
* Generate up to 36 bits of VENDOR SPECIFIC IDENTIFIER starting on
* byte 3 bit 3-0 for NAA IEEE Registered Extended DESIGNATOR field
Expand All @@ -169,19 +169,18 @@ target_parse_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf_of
* NUMBER set via vpd_unit_serial in target_core_configfs.c to ensure
* per device uniqeness.
*/
while (*p != '\0') {
if (cnt >= 13)
break;
if (!isxdigit(*p)) {
p++;
for (cnt = 0; *p && cnt < 13; p++) {
int val = hex_to_bin(*p);

if (val < 0)
continue;
}
if (next != 0) {
buf[cnt++] |= hex_to_bin(*p++);
next = 0;

if (next) {
next = false;
buf[cnt++] |= val;
} else {
buf[cnt] = hex_to_bin(*p++) << 4;
next = 1;
next = true;
buf[cnt] = val << 4;
}
}
}
Expand Down

0 comments on commit 5c3ce8e

Please sign in to comment.