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>
This commit is contained in:

committed by
Linus Torvalds

parent
3094141c65
commit
ecc3099002
@@ -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) {
|
||||
|
Reference in New Issue
Block a user