lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 11 Sep 2010 16:38:00 +0300
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Andy Shevchenko <andy.shevchenko@...il.com>,
	"James E.J. Bottomley" <James.Bottomley@...e.de>,
	linux-scsi@...r.kernel.org
Subject: [PATCH] drivers: scsi: remove private hex_to_bin() implementation

Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: "James E.J. Bottomley" <James.Bottomley@...e.de>
Cc: linux-scsi@...r.kernel.org
---
 drivers/scsi/libsas/sas_scsi_host.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
index f0cfba9..527dcf7 100644
--- a/drivers/scsi/libsas/sas_scsi_host.c
+++ b/drivers/scsi/libsas/sas_scsi_host.c
@@ -1078,14 +1078,10 @@ void sas_target_destroy(struct scsi_target *starget)
 static void sas_parse_addr(u8 *sas_addr, const char *p)
 {
 	int i;
-	for (i = 0; i < SAS_ADDR_SIZE; i++) {
+	for (i = 0; i < SAS_ADDR_SIZE && *p; i++) {
 		u8 h, l;
-		if (!*p)
-			break;
-		h = isdigit(*p) ? *p-'0' : toupper(*p)-'A'+10;
-		p++;
-		l = isdigit(*p) ? *p-'0' : toupper(*p)-'A'+10;
-		p++;
+		h = hex_to_bin(*p++);
+		l = hex_to_bin(*p++);
 		sas_addr[i] = (h<<4) | l;
 	}
 }
-- 
1.7.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ