Commit 02839a8b authored by Dave Jiang's avatar Dave Jiang Committed by Dan Williams

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: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent ca507b98
...@@ -92,24 +92,14 @@ struct isci_orom *isci_request_oprom(struct pci_dev *pdev) ...@@ -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, enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params,
struct isci_orom *orom, int scu_index) struct isci_orom *orom, int scu_index)
{ {
int i;
/* check for valid inputs */ /* check for valid inputs */
if (!(scu_index >= 0 if (scu_index < 0 || scu_index > SCI_MAX_CONTROLLERS ||
&& scu_index < SCI_MAX_CONTROLLERS scu_index > orom->hdr.num_elements || !oem_params)
&& oem_params != NULL))
return -EINVAL; return -EINVAL;
for (i = 0; i < SCI_MAX_PHYS; i++) { memcpy(oem_params,
oem_params->sds1.phys[i].sas_address.low = &orom->ctrl[scu_index],
orom->ctrl[scu_index].phys[i].sas_address.low; sizeof(struct scic_sds_oem_params));
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;
return 0; return 0;
} }
......
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