diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-08-07 14:27:57 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-08-07 14:27:57 -0700 |
commit | dcb79b15449fc3e4427a3d1cbcc72661ba13622d (patch) | |
tree | b9b47beca74920b4f6596e898ee5b22f602f669a /drivers/acpi/nfit | |
parent | 401c0a19c6c22efcaff85d5a64a396f9130da2ca (diff) | |
download | talos-obmc-linux-dcb79b15449fc3e4427a3d1cbcc72661ba13622d.tar.gz talos-obmc-linux-dcb79b15449fc3e4427a3d1cbcc72661ba13622d.zip |
nfit: cleanup long de-reference chains in acpi_nfit_init_interleave_set
Use a local 'struct acpi_nfit_control_region *' variable to shorten the
pointer chasing chains.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit')
-rw-r--r-- | drivers/acpi/nfit/core.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index be231a549eb0..2c5608b92578 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1804,6 +1804,7 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); struct acpi_nfit_memory_map *memdev = memdev_from_spa(acpi_desc, spa->range_index, i); + struct acpi_nfit_control_region *dcr = nfit_mem->dcr; if (!memdev || !nfit_mem->dcr) { dev_err(dev, "%s: failed to find DCR\n", __func__); @@ -1811,13 +1812,13 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, } map->region_offset = memdev->region_offset; - map->serial_number = nfit_mem->dcr->serial_number; + map->serial_number = dcr->serial_number; map2->region_offset = memdev->region_offset; - map2->serial_number = nfit_mem->dcr->serial_number; - map2->vendor_id = nfit_mem->dcr->vendor_id; - map2->manufacturing_date = nfit_mem->dcr->manufacturing_date; - map2->manufacturing_location = nfit_mem->dcr->manufacturing_location; + map2->serial_number = dcr->serial_number; + map2->vendor_id = dcr->vendor_id; + map2->manufacturing_date = dcr->manufacturing_date; + map2->manufacturing_location = dcr->manufacturing_location; } /* v1.1 namespaces */ @@ -1844,15 +1845,13 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, struct nd_mapping_desc *mapping = &ndr_desc->mapping[j]; struct nvdimm *nvdimm = mapping->nvdimm; struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); + struct acpi_nfit_control_region *dcr = nfit_mem->dcr; - if (map2->serial_number - == nfit_mem->dcr->serial_number && - map2->vendor_id - == nfit_mem->dcr->vendor_id && - map2->manufacturing_date - == nfit_mem->dcr->manufacturing_date && + if (map2->serial_number == dcr->serial_number && + map2->vendor_id == dcr->vendor_id && + map2->manufacturing_date == dcr->manufacturing_date && map2->manufacturing_location - == nfit_mem->dcr->manufacturing_location) { + == dcr->manufacturing_location) { mapping->position = i; break; } |