diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-02-24 20:45:57 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 06:55:30 -0400 |
commit | 02839a8b51002d90e4b7c52bf37531834b063f71 (patch) | |
tree | d7a6e6b63a0c6876ecf391ff92f1eecbd50b582f /drivers/scsi/isci | |
parent | ca507b98e65f539e0b3866b6aa8efd76c13be285 (diff) |
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>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r-- | drivers/scsi/isci/probe_roms.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/scsi/isci/probe_roms.c b/drivers/scsi/isci/probe_roms.c index 927feaddc04d..822240578115 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) | |||
92 | enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params, | 92 | enum sci_status isci_parse_oem_parameters(union scic_oem_parameters *oem_params, |
93 | struct isci_orom *orom, int scu_index) | 93 | struct isci_orom *orom, int scu_index) |
94 | { | 94 | { |
95 | int i; | ||
96 | |||
97 | /* check for valid inputs */ | 95 | /* check for valid inputs */ |
98 | if (!(scu_index >= 0 | 96 | if (scu_index < 0 || scu_index > SCI_MAX_CONTROLLERS || |
99 | && scu_index < SCI_MAX_CONTROLLERS | 97 | scu_index > orom->hdr.num_elements || !oem_params) |
100 | && oem_params != NULL)) | ||
101 | return -EINVAL; | 98 | return -EINVAL; |
102 | 99 | ||
103 | for (i = 0; i < SCI_MAX_PHYS; i++) { | 100 | memcpy(oem_params, |
104 | oem_params->sds1.phys[i].sas_address.low = | 101 | &orom->ctrl[scu_index], |
105 | orom->ctrl[scu_index].phys[i].sas_address.low; | 102 | sizeof(struct scic_sds_oem_params)); |
106 | oem_params->sds1.phys[i].sas_address.high = | ||
107 | orom->ctrl[scu_index].phys[i].sas_address.high; | ||
108 | } | ||
109 | |||
110 | for (i = 0; i < SCI_MAX_PORTS; i++) | ||
111 | oem_params->sds1.ports[i].phy_mask = | ||
112 | orom->ctrl[scu_index].ports[i].phy_mask; | ||
113 | 103 | ||
114 | return 0; | 104 | return 0; |
115 | } | 105 | } |