From: Rafael J. Wysocki Date: Wed, 3 Jun 2026 17:57:36 +0000 (+0200) Subject: ACPI: NFIT: core: Eliminate redundant local variable X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=9995e4404ea4c3026459d13dd545b10ef8989469;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Dave Jiang Link: https://patch.msgid.link/14028918.uLZWGnKmhe@rafael.j.wysocki --- diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 01c73be0bd00..aaa84ae7a20e 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -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);