Commit cfe5badc authored by Scott Teel's avatar Scott Teel Committed by James Bottomley

[SCSI] hpsa: rename HPSA_MAX_SCSI_DEVS_PER_HBA

Rename HPSA_MAX_SCSI_DEVS_PER_HBA to HPSA_MAX_DEVICES
Signed-off-by: default avatarScott Teel <scott.teel@hp.com>
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 03ab31f4
...@@ -567,16 +567,16 @@ static int hpsa_find_target_lun(struct ctlr_info *h, ...@@ -567,16 +567,16 @@ static int hpsa_find_target_lun(struct ctlr_info *h,
* assumes h->devlock is held * assumes h->devlock is held
*/ */
int i, found = 0; int i, found = 0;
DECLARE_BITMAP(lun_taken, HPSA_MAX_SCSI_DEVS_PER_HBA); DECLARE_BITMAP(lun_taken, HPSA_MAX_DEVICES);
memset(&lun_taken[0], 0, HPSA_MAX_SCSI_DEVS_PER_HBA >> 3); memset(&lun_taken[0], 0, HPSA_MAX_DEVICES >> 3);
for (i = 0; i < h->ndevices; i++) { for (i = 0; i < h->ndevices; i++) {
if (h->dev[i]->bus == bus && h->dev[i]->target != -1) if (h->dev[i]->bus == bus && h->dev[i]->target != -1)
set_bit(h->dev[i]->target, lun_taken); set_bit(h->dev[i]->target, lun_taken);
} }
for (i = 0; i < HPSA_MAX_SCSI_DEVS_PER_HBA; i++) { for (i = 0; i < HPSA_MAX_DEVICES; i++) {
if (!test_bit(i, lun_taken)) { if (!test_bit(i, lun_taken)) {
/* *bus = 1; */ /* *bus = 1; */
*target = i; *target = i;
...@@ -599,7 +599,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno, ...@@ -599,7 +599,7 @@ static int hpsa_scsi_add_entry(struct ctlr_info *h, int hostno,
unsigned char addr1[8], addr2[8]; unsigned char addr1[8], addr2[8];
struct hpsa_scsi_dev_t *sd; struct hpsa_scsi_dev_t *sd;
if (n >= HPSA_MAX_SCSI_DEVS_PER_HBA) { if (n >= HPSA_MAX_DEVICES) {
dev_err(&h->pdev->dev, "too many devices, some will be " dev_err(&h->pdev->dev, "too many devices, some will be "
"inaccessible.\n"); "inaccessible.\n");
return -1; return -1;
...@@ -674,7 +674,7 @@ static void hpsa_scsi_replace_entry(struct ctlr_info *h, int hostno, ...@@ -674,7 +674,7 @@ static void hpsa_scsi_replace_entry(struct ctlr_info *h, int hostno,
struct hpsa_scsi_dev_t *removed[], int *nremoved) struct hpsa_scsi_dev_t *removed[], int *nremoved)
{ {
/* assumes h->devlock is held */ /* assumes h->devlock is held */
BUG_ON(entry < 0 || entry >= HPSA_MAX_SCSI_DEVS_PER_HBA); BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES);
removed[*nremoved] = h->dev[entry]; removed[*nremoved] = h->dev[entry];
(*nremoved)++; (*nremoved)++;
...@@ -703,7 +703,7 @@ static void hpsa_scsi_remove_entry(struct ctlr_info *h, int hostno, int entry, ...@@ -703,7 +703,7 @@ static void hpsa_scsi_remove_entry(struct ctlr_info *h, int hostno, int entry,
int i; int i;
struct hpsa_scsi_dev_t *sd; struct hpsa_scsi_dev_t *sd;
BUG_ON(entry < 0 || entry >= HPSA_MAX_SCSI_DEVS_PER_HBA); BUG_ON(entry < 0 || entry >= HPSA_MAX_DEVICES);
sd = h->dev[entry]; sd = h->dev[entry];
removed[*nremoved] = h->dev[entry]; removed[*nremoved] = h->dev[entry];
...@@ -815,10 +815,8 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno, ...@@ -815,10 +815,8 @@ static void adjust_hpsa_scsi_table(struct ctlr_info *h, int hostno,
int nadded, nremoved; int nadded, nremoved;
struct Scsi_Host *sh = NULL; struct Scsi_Host *sh = NULL;
added = kzalloc(sizeof(*added) * HPSA_MAX_SCSI_DEVS_PER_HBA, added = kzalloc(sizeof(*added) * HPSA_MAX_DEVICES, GFP_KERNEL);
GFP_KERNEL); removed = kzalloc(sizeof(*removed) * HPSA_MAX_DEVICES, GFP_KERNEL);
removed = kzalloc(sizeof(*removed) * HPSA_MAX_SCSI_DEVS_PER_HBA,
GFP_KERNEL);
if (!added || !removed) { if (!added || !removed) {
dev_warn(&h->pdev->dev, "out of memory in " 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,8 +1845,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
int raid_ctlr_position; int raid_ctlr_position;
DECLARE_BITMAP(lunzerobits, HPSA_MAX_TARGETS_PER_CTLR); DECLARE_BITMAP(lunzerobits, HPSA_MAX_TARGETS_PER_CTLR);
currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_SCSI_DEVS_PER_HBA, currentsd = kzalloc(sizeof(*currentsd) * HPSA_MAX_DEVICES, GFP_KERNEL);
GFP_KERNEL);
physdev_list = kzalloc(reportlunsize, GFP_KERNEL); physdev_list = kzalloc(reportlunsize, GFP_KERNEL);
logdev_list = kzalloc(reportlunsize, GFP_KERNEL); logdev_list = kzalloc(reportlunsize, GFP_KERNEL);
tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL); tmpdevice = kzalloc(sizeof(*tmpdevice), GFP_KERNEL);
...@@ -1957,7 +1954,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno) ...@@ -1957,7 +1954,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno)
default: default:
break; break;
} }
if (ncurrent >= HPSA_MAX_SCSI_DEVS_PER_HBA) if (ncurrent >= HPSA_MAX_DEVICES)
break; break;
} }
adjust_hpsa_scsi_table(h, hostno, currentsd, ncurrent); adjust_hpsa_scsi_table(h, hostno, currentsd, ncurrent);
......
...@@ -102,8 +102,8 @@ struct ctlr_info { ...@@ -102,8 +102,8 @@ struct ctlr_info {
struct Scsi_Host *scsi_host; struct Scsi_Host *scsi_host;
spinlock_t devlock; /* to protect hba[ctlr]->dev[]; */ spinlock_t devlock; /* to protect hba[ctlr]->dev[]; */
int ndevices; /* number of used elements in .dev[] array. */ int ndevices; /* number of used elements in .dev[] array. */
#define HPSA_MAX_SCSI_DEVS_PER_HBA 256 #define HPSA_MAX_DEVICES 256
struct hpsa_scsi_dev_t *dev[HPSA_MAX_SCSI_DEVS_PER_HBA]; struct hpsa_scsi_dev_t *dev[HPSA_MAX_DEVICES];
/* /*
* Performant mode tables. * Performant mode tables.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment