From 2655b8bdb8bd72c38e1a45cf994a17d57f03733a Mon Sep 17 00:00:00 2001 From: "Stephen M. Cameron" Date: Thu, 27 May 2010 15:13:32 -0500 Subject: [PATCH] --- yaml --- r: 204059 b: refs/heads/master c: 76c46e4970f7ee6d8c54220a767e93d67b74cd33 h: refs/heads/master i: 204057: 2c79c1c8fc19cb926eb73b598541b9d241442115 204055: 41b21cc2218c0dcd97cc9ada2f06e753f45738c0 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/hpsa.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f010e6ee4b9a..8c71ec257ca3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b93d7536eaa1206ad4a00ad8ea700ff0bd75a0da +refs/heads/master: 76c46e4970f7ee6d8c54220a767e93d67b74cd33 diff --git a/trunk/drivers/scsi/hpsa.c b/trunk/drivers/scsi/hpsa.c index dcbe54b1dfba..f2a9af64dfaa 100644 --- a/trunk/drivers/scsi/hpsa.c +++ b/trunk/drivers/scsi/hpsa.c @@ -3372,6 +3372,18 @@ 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')) { + dev_warn(&h->pdev->dev, "not a valid CISS config table\n"); + return false; + } + return true; +} + static int __devinit hpsa_pci_init(struct ctlr_info *h) { int i, prod_index, err; @@ -3415,11 +3427,7 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h) goto err_out_free_res; hpsa_find_board_params(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')) { - dev_warn(&h->pdev->dev, "not a valid CISS config table\n"); + if (!hpsa_CISS_signature_present(h)) { err = -ENODEV; goto err_out_free_res; }