summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2011-02-24 17:45:57 -0800
committerDan Williams <dan.j.williams@intel.com>2011-07-03 03:55:30 -0700
commit02839a8b51002d90e4b7c52bf37531834b063f71 (patch)
treed7a6e6b63a0c6876ecf391ff92f1eecbd50b582f
parentca507b98e65f539e0b3866b6aa8efd76c13be285 (diff)
downloadop-kernel-dev-02839a8b51002d90e4b7c52bf37531834b063f71.zip
op-kernel-dev-02839a8b51002d90e4b7c52bf37531834b063f71.tar.gz
isci: copy the oem parameters instead of assign
Since the data structure for oem from orom/efi/firmware is the same as what the core uses, we can just do a direct copy instead of assignment. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/scsi/isci/probe_roms.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/scsi/isci/probe_roms.c b/drivers/scsi/isci/probe_roms.c
index 927fead..8222405 100644
--- a/drivers/scsi/isci/probe_roms.c
+++ b/drivers/scsi/isci/probe_roms.c
@@ -92,24 +92,14 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev)
enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params,
struct isci_orom *orom, int scu_index)
{
- int i;
-
/* check for valid inputs */
- if (!(scu_index >= 0
- && scu_index < SCI_MAX_CONTROLLERS
- && oem_params != NULL))
+ if (scu_index < 0 || scu_index > SCI_MAX_CONTROLLERS ||
+ scu_index > orom->hdr.num_elements || !oem_params)
return -EINVAL;
- for (i = 0; i < SCI_MAX_PHYS; i++) {
- oem_params->sds1.phys[i].sas_address.low =
- orom->ctrl[scu_index].phys[i].sas_address.low;
- oem_params->sds1.phys[i].sas_address.high =
- orom->ctrl[scu_index].phys[i].sas_address.high;
- }
-
- for (i = 0; i < SCI_MAX_PORTS; i++)
- oem_params->sds1.ports[i].phy_mask =
- orom->ctrl[scu_index].ports[i].phy_mask;
+ memcpy(oem_params,
+ &orom->ctrl[scu_index],
+ sizeof(struct scic_sds_oem_params));
return 0;
}
OpenPOWER on IntegriCloud