aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-02-04 09:42:19 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 14:19:14 -0500
commit6df1e95496f8dfe08a520756187be59f7896f589 (patch)
tree3a9483657267a0d105c5b3ba227928058c07a7dd /drivers/scsi/hpsa.c
parenta9a44cbd4b41bf4b9535c1eb7f5e942d8b2e9d54 (diff)
[SCSI] hpsa: eliminate unnecessary memcpys
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c11
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,