diff options
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 45942007bdc7..ba3deaddf150 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -1483,14 +1483,11 @@ static void figure_bus_target_lun(struct ctlr_info *h, | |||
1483 | u8 *lunaddrbytes, int *bus, int *target, int *lun, | 1483 | u8 *lunaddrbytes, int *bus, int *target, int *lun, |
1484 | struct hpsa_scsi_dev_t *device) | 1484 | struct hpsa_scsi_dev_t *device) |
1485 | { | 1485 | { |
1486 | |||
1487 | u32 lunid; | 1486 | u32 lunid; |
1488 | 1487 | ||
1489 | if (is_logical_dev_addr_mode(lunaddrbytes)) { | 1488 | if (is_logical_dev_addr_mode(lunaddrbytes)) { |
1490 | /* logical device */ | 1489 | /* logical device */ |
1491 | memcpy(&lunid, lunaddrbytes, sizeof(lunid)); | 1490 | lunid = le32_to_cpu(*((__le32 *) lunaddrbytes)); |
1492 | lunid = le32_to_cpu(lunid); | ||
1493 | |||
1494 | if (is_msa2xxx(h, device)) { | 1491 | if (is_msa2xxx(h, device)) { |
1495 | *bus = 1; | 1492 | *bus = 1; |
1496 | *target = (lunid >> 16) & 0x3fff; | 1493 | *target = (lunid >> 16) & 0x3fff; |
@@ -1578,8 +1575,7 @@ static int hpsa_gather_lun_info(struct ctlr_info *h, | |||
1578 | dev_err(&h->pdev->dev, "report physical LUNs failed.\n"); | 1575 | dev_err(&h->pdev->dev, "report physical LUNs failed.\n"); |
1579 | return -1; | 1576 | return -1; |
1580 | } | 1577 | } |
1581 | memcpy(nphysicals, &physdev->LUNListLength[0], sizeof(*nphysicals)); | 1578 | *nphysicals = be32_to_cpu(*((__be32 *)physdev->LUNListLength)) / 8; |
1582 | *nphysicals = be32_to_cpu(*nphysicals) / 8; | ||
1583 | if (*nphysicals > HPSA_MAX_PHYS_LUN) { | 1579 | if (*nphysicals > HPSA_MAX_PHYS_LUN) { |
1584 | dev_warn(&h->pdev->dev, "maximum physical LUNs (%d) exceeded." | 1580 | dev_warn(&h->pdev->dev, "maximum physical LUNs (%d) exceeded." |
1585 | " %d LUNs ignored.\n", HPSA_MAX_PHYS_LUN, | 1581 | " %d LUNs ignored.\n", HPSA_MAX_PHYS_LUN, |
@@ -1590,8 +1586,7 @@ static int hpsa_gather_lun_info(struct ctlr_info *h, | |||
1590 | dev_err(&h->pdev->dev, "report logical LUNs failed.\n"); | 1586 | dev_err(&h->pdev->dev, "report logical LUNs failed.\n"); |
1591 | return -1; | 1587 | return -1; |
1592 | } | 1588 | } |
1593 | memcpy(nlogicals, &logdev->LUNListLength[0], sizeof(*nlogicals)); | 1589 | *nlogicals = be32_to_cpu(*((__be32 *) logdev->LUNListLength)) / 8; |
1594 | *nlogicals = be32_to_cpu(*nlogicals) / 8; | ||
1595 | /* Reject Logicals in excess of our max capability. */ | 1590 | /* Reject Logicals in excess of our max capability. */ |
1596 | if (*nlogicals > HPSA_MAX_LUN) { | 1591 | if (*nlogicals > HPSA_MAX_LUN) { |
1597 | dev_warn(&h->pdev->dev, | 1592 | dev_warn(&h->pdev->dev, |