Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264679
b: refs/heads/master
c: 635a2b3
h: refs/heads/master
i:
  264677: e224e18
  264675: 0886a84
  264671: 8f76ba5
v: v3
  • Loading branch information
Andy Shevchenko authored and Nicholas Bellinger committed Oct 24, 2011
1 parent e1de654 commit f2f7fdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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: f2b56afd406b455fba339a35f43bfc4ada198073
refs/heads/master: 635a2b3f3e561278cb5b837ea305e50e3fa7f063
12 changes: 5 additions & 7 deletions trunk/drivers/target/tcm_fc/tfc_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/configfs.h>
#include <linux/kernel.h>
#include <linux/ctype.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
Expand Down Expand Up @@ -70,10 +71,10 @@ static ssize_t ft_parse_wwn(const char *name, u64 *wwn, int strict)
{
const char *cp;
char c;
u32 nibble;
u32 byte = 0;
u32 pos = 0;
u32 err;
int val;

*wwn = 0;
for (cp = name; cp < &name[FT_NAMELEN - 1]; cp++) {
Expand All @@ -94,13 +95,10 @@ static ssize_t ft_parse_wwn(const char *name, u64 *wwn, int strict)
return cp - name;
}
err = 3;
if (isdigit(c))
nibble = c - '0';
else if (isxdigit(c) && (islower(c) || !strict))
nibble = tolower(c) - 'a' + 10;
else
val = hex_to_bin(c);
if (val < 0 || (strict && isupper(c)))
goto fail;
*wwn = (*wwn << 4) | nibble;
*wwn = (*wwn << 4) | val;
}
err = 4;
fail:
Expand Down

0 comments on commit f2f7fdf

Please sign in to comment.