aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorAndy Shevchenko <ext-andriy.shevchenko@nokia.com>2010-08-10 21:01:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:02 -0400
commitecc3099002c1cc87e9e4b3dc5fdf7821828f6733 (patch)
tree7dff340773a244ef2eac7907a6b88c0c4131ac3a /drivers/scsi/scsi_transport_fc.c
parent3094141c6532a4f748425c21c091001f218da8ae (diff)
drivers: scsi: use newly introduced hex_to_bin() method
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com> Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com> Cc: "James E.J. Bottomley" <James.Bottomley@suse.de> Cc: James Smart <james.smart@emulex.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index edb6b362a8fa..d7e470a06180 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -29,6 +29,7 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/kernel.h>
32#include <scsi/scsi_device.h> 33#include <scsi/scsi_device.h>
33#include <scsi/scsi_host.h> 34#include <scsi/scsi_host.h>
34#include <scsi/scsi_transport.h> 35#include <scsi/scsi_transport.h>
@@ -1730,12 +1731,11 @@ fc_parse_wwn(const char *ns, u64 *nm)
1730 1731
1731 /* Validate and store the new name */ 1732 /* Validate and store the new name */
1732 for (i=0, j=0; i < 16; i++) { 1733 for (i=0, j=0; i < 16; i++) {
1733 if ((*ns >= 'a') && (*ns <= 'f')) 1734 int value;
1734 j = ((j << 4) | ((*ns++ -'a') + 10)); 1735
1735 else if ((*ns >= 'A') && (*ns <= 'F')) 1736 value = hex_to_bin(*ns++);
1736 j = ((j << 4) | ((*ns++ -'A') + 10)); 1737 if (value >= 0)
1737 else if ((*ns >= '0') && (*ns <= '9')) 1738 j = (j << 4) | value;
1738 j = ((j << 4) | (*ns++ -'0'));
1739 else 1739 else
1740 return -EINVAL; 1740 return -EINVAL;
1741 if (i % 2) { 1741 if (i % 2) {