]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: NFIT: core: Eliminate redundant local variable
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Jun 2026 17:57:36 +0000 (19:57 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 8 Jun 2026 12:13:57 +0000 (14:13 +0200)
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
drivers/acpi/nfit/core.c

index 01c73be0bd00f6880e0c851e6f86fc11974b37a5..aaa84ae7a20e893e4d9eb6ef2c194e41c7f45505 100644 (file)
@@ -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);