diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2010-08-10 18:01:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 08:59:02 -0700 |
commit | ecc3099002c1cc87e9e4b3dc5fdf7821828f6733 (patch) | |
tree | 7dff340773a244ef2eac7907a6b88c0c4131ac3a /drivers/scsi/scsi_transport_fc.c | |
parent | 3094141c6532a4f748425c21c091001f218da8ae (diff) | |
download | kernel_samsung_tuna-ecc3099002c1cc87e9e4b3dc5fdf7821828f6733.zip kernel_samsung_tuna-ecc3099002c1cc87e9e4b3dc5fdf7821828f6733.tar.gz kernel_samsung_tuna-ecc3099002c1cc87e9e4b3dc5fdf7821828f6733.tar.bz2 |
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.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index edb6b36..d7e470a 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -29,6 +29,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/delay.h> +#include <linux/kernel.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include <scsi/scsi_transport.h> @@ -1730,12 +1731,11 @@ fc_parse_wwn(const char *ns, u64 *nm) /* Validate and store the new name */ for (i=0, j=0; i < 16; i++) { - if ((*ns >= 'a') && (*ns <= 'f')) - j = ((j << 4) | ((*ns++ -'a') + 10)); - else if ((*ns >= 'A') && (*ns <= 'F')) - j = ((j << 4) | ((*ns++ -'A') + 10)); - else if ((*ns >= '0') && (*ns <= '9')) - j = ((j << 4) | (*ns++ -'0')); + int value; + + value = hex_to_bin(*ns++); + if (value >= 0) + j = (j << 4) | value; else return -EINVAL; if (i % 2) { |