aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorScott Teel <scott.teel@hp.com>2011-10-26 17:21:07 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-30 06:16:38 -0400
commitcfe5badcab2e993e71ebebbc07c21c270e5580c0 (patch)
tree438ae97173277c62a241d6775bf208a4d5c65ec6 /drivers/scsi/hpsa.c
parent03ab31f4c14f259bfa160543c83dbfd93d6fb3e2 (diff)
[SCSI] hpsa: rename HPSA_MAX_SCSI_DEVS_PER_HBA
Rename HPSA_MAX_SCSI_DEVS_PER_HBA to HPSA_MAX_DEVICES Signed-off-by: Scott Teel <scott.teel@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index c89bed12cb55..f661ad1e500c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -567,16 +567,16 @@ static int hpsa_find_target_lun(struct ctlr_info *h,
567 * assumes h->devlock is held 567 * assumes h->devlock is held
568 */ 568 */
569 int i, found = 0; 569 int i, found = 0;
570 DECLARE_BITMAP(lun_taken, HPSA_MAX_SCSI_DEVS_PER_HBA); 570 DECLARE_BITMAP(lun_taken, HPSA_MAX_DEVICES);
571 571
572 memset(&lun_taken[0], 0, HPSA_MAX_SCSI_DEVS_PER_HBA >> 3); 572 memset(&lun_taken[0], 0, HPSA_MAX_DEVICES >> 3);
573 573
574 for (i = 0; i < h->ndevices; i++) { 574 for (i = 0; i < h->ndevices; i++) {
575 if (h->dev[i]->bus == bus && h->dev[i]->target != -1) 575 if (h->dev[i]->bus == bus && h->dev[i]->target != -1)
576 set_bit(h->dev[i]->target, lun_taken); 576 set_bit(h->dev[i]->target, lun_taken);
577 } 577 }
578 578
579 for (i = 0; i < HPSA_MAX_SCSI_DEVS_PER_HBA; i++) { 579 for (i = 0; i < HPSA_MAX_DEVICES; i++) {
580 if (!test_bit(i, lun_taken)) { 580 if (!test_bit(i, lun_taken)) {
581 /* *bus = 1; */ 581 /* *bus = 1; */
582 *target = i; 582 *target = i;
@@ -599,7 +599,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno,
599 unsigned char addr1[8], addr2[8]; 599 unsigned char addr1[8], addr2[8];
600 struct hpsa_scsi_dev_t *sd; 600 struct hpsa_scsi_dev_t *sd;
601 601
602 if (n >= HPSA_MAX_SCSI_DEVS_PER_HBA) { 602 if (n >= HPSA_MAX_DEVICES) {
603 dev_err(&h->pdev->dev, "too many devices, some will be " 603 dev_err(&h->pdev->dev, "too many devices, some will be "
604 "inaccessible.\n"); 604 "inaccessible.\n");
605 return -1; 605 return -1;
@@ -674,7 +674,7 @@ static void hpsa_scsi_replace_entry(struct ctlr_info *h, int hostno,
674 struct hpsa_scsi_dev_t *removed[], int *nremoved) 674 struct hpsa_scsi_dev_t *removed[], int *nremoved)
675{ 675{
676 /* assumes h->devlock is held */ 676 /* assumes h->devlock is held */
677 BUG_ON(entry < 0 || entry >= HPSA_MAX_SCSI_DEVS_PER_HBA); 677 BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES);
678 removed[*nremoved] = h->dev[entry]; 678 removed[*nremoved] = h->dev[entry];
679 (*nremoved)++; 679 (*nremoved)++;
680 680
@@ -703,7 +703,7 @@ static void hpsa_scsi_remove_entry(struct ctlr_info *h, int hostno, int entry,
703 int i; 703 int i;
704 struct hpsa_scsi_dev_t *sd; 704 struct hpsa_scsi_dev_t *sd;
705 705
706 BUG_ON(entry < 0 || entry >= HPSA_MAX_SCSI_DEVS_PER_HBA); 706 BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES);
707 707
708 sd = h->dev[entry]; 708 sd = h->dev[entry];
709 removed[*nremoved] = h->dev[entry]; 709 removed[*nremoved] = h->dev[entry];
@@ -815,10 +815,8 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno,
815 int nadded, nremoved; 815 int nadded, nremoved;
816 struct Scsi_Host *sh = NULL; 816 struct Scsi_Host *sh = NULL;
817 817
818 added = kzalloc(sizeof(*added) * HPSA_MAX_SCSI_DEVS_PER_HBA, 818 added = kzalloc(sizeof(*added) * HPSA_MAX_DEVICES, GFP_KERNEL);
819 GFP_KERNEL); 819 removed = kzalloc(sizeof(*removed) * HPSA_MAX_DEVICES, GFP_KERNEL);
820 removed = kzalloc(sizeof(*removed) * HPSA_MAX_SCSI_DEVS_PER_HBA,
821 GFP_KERNEL);
822 820
823 if (!added || !removed) { 821 if (!added || !removed) {
824 dev_warn(&h->pdev->dev, "out of memory in " 822 dev_warn(&h->pdev->dev, "out of memory in "
@@ -1847,8 +1845,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
1847 int raid_ctlr_position; 1845 int raid_ctlr_position;
1848 DECLARE_BITMAP(lunzerobits, HPSA_MAX_TARGETS_PER_CTLR); 1846 DECLARE_BITMAP(lunzerobits, HPSA_MAX_TARGETS_PER_CTLR);
1849 1847
1850 currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_SCSI_DEVS_PER_HBA, 1848 currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_DEVICES, GFP_KERNEL);
1851 GFP_KERNEL);
1852 physdev_list = kzalloc(reportlunsize, GFP_KERNEL); 1849 physdev_list = kzalloc(reportlunsize, GFP_KERNEL);
1853 logdev_list = kzalloc(reportlunsize, GFP_KERNEL); 1850 logdev_list = kzalloc(reportlunsize, GFP_KERNEL);
1854 tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL); 1851 tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL);
@@ -1957,7 +1954,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
1957 default: 1954 default:
1958 break; 1955 break;
1959 } 1956 }
1960 if (ncurrent >= HPSA_MAX_SCSI_DEVS_PER_HBA) 1957 if (ncurrent >= HPSA_MAX_DEVICES)
1961 break; 1958 break;
1962 } 1959 }
1963 adjust_hpsa_scsi_table(h, hostno, currentsd, ncurrent); 1960 adjust_hpsa_scsi_table(h, hostno, currentsd, ncurrent);