mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-23 09:47:31 -04:00
ACPI: NFIT: core: Eliminate redundant local variable
Eliminate local variable acpi_desc from __acpi_nvdimm_notify() because it is redundant (its value is only checked against NULL once and the value assigned to it may be checked directly instead) and update the subsequent comment to reflect the code change. No functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://patch.msgid.link/14028918.uLZWGnKmhe@rafael.j.wysocki
This commit is contained in:
@@ -1680,7 +1680,6 @@ static struct nvdimm *acpi_nfit_dimm_by_handle(struct acpi_nfit_desc *acpi_desc,
|
||||
void __acpi_nvdimm_notify(struct device *dev, u32 event)
|
||||
{
|
||||
struct nfit_mem *nfit_mem;
|
||||
struct acpi_nfit_desc *acpi_desc;
|
||||
|
||||
dev_dbg(dev->parent, "%s: event: %d\n", dev_name(dev),
|
||||
event);
|
||||
@@ -1691,12 +1690,11 @@ void __acpi_nvdimm_notify(struct device *dev, u32 event)
|
||||
return;
|
||||
}
|
||||
|
||||
acpi_desc = dev_get_drvdata(dev->parent);
|
||||
if (!acpi_desc)
|
||||
if (!dev_get_drvdata(dev->parent))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If we successfully retrieved acpi_desc, then we know nfit_mem data
|
||||
* If the parent's driver data pointer is not NULL, then nfit_mem data
|
||||
* is still valid.
|
||||
*/
|
||||
nfit_mem = dev_get_drvdata(dev);
|
||||
|
||||
Reference in New Issue
Block a user