Skip to contentSkip to conversation

hpsa: use check_signature

PATCH New Akinobu Mita 1 participant 1 message Apr 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hpsa: use check_signature

Use check_signature to find a signature in the mmio address.

---
v2: select CHECK_SIGNATURE in Kconfig

 drivers/scsi/Kconfig |    1 +
 drivers/scsi/hpsa.c  |    5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/scsi/Kconfig +1 -0
index 29684c8..bea04e5 100644
@@ -408,6 +408,7 @@ config BLK_DEV_3W_XXXX_RAID
 config SCSI_HPSA
 	tristate "HP Smart Array SCSI driver"
 	depends on PCI && SCSI
+	select CHECK_SIGNATURE
 	help
 	  This driver supports HP Smart Array Controllers (circa 2009).
 	  It is a SCSI alternative to the cciss driver, which is a block
drivers/scsi/hpsa.c +1 -4
index ddbf5fe..c867eeb 100644
@@ -3839,10 +3839,7 @@ static void __devinit hpsa_find_board_params(struct ctlr_info *h)
 
 static inline bool hpsa_CISS_signature_present(struct ctlr_info *h)
 {
-	if ((readb(&h->cfgtable->Signature[0]) != 'C') ||
-	    (readb(&h->cfgtable->Signature[1]) != 'I') ||
-	    (readb(&h->cfgtable->Signature[2]) != 'S') ||
-	    (readb(&h->cfgtable->Signature[3]) != 'S')) {
+	if (!check_signature(h->cfgtable->Signature, "CISS", 4)) {
 		dev_warn(&h->pdev->dev, "not a valid CISS config table\n");
 		return false;
 	}
Signature · 1 line
1.7.4.4