From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Dan Williams <djbw@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Vishal Verma <vishal.l.verma@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
nvdimm@lists.linux.dev,
Alison Schofield <alison.schofield@intel.com>,
Xiang Chen <chenxiang66@hisilicon.com>
Subject: [PATCH v2 3/4] ACPI: NFIT: core: Eliminate redundant local variable
Date: Wed, 03 Jun 2026 19:57:36 +0200 [thread overview]
Message-ID: <14028918.uLZWGnKmhe@rafael.j.wysocki> (raw)
In-Reply-To: <5110904.31r3eYUQgx@rafael.j.wysocki>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
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>
---
drivers/acpi/nfit/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
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);
--
2.51.0
next prev parent reply other threads:[~2026-06-03 17:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 17:55 [PATCH v2 0/4] ACPI: NFIT: core: Fix multiple issues related to concurrency and cleanup Rafael J. Wysocki
2026-06-03 17:56 ` [PATCH v2 1/4] ACPI: NFIT: core: Fix possible NULL pointer dereference Rafael J. Wysocki
2026-06-03 22:33 ` Dave Jiang
2026-06-03 17:57 ` [PATCH v2 2/4] ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup Rafael J. Wysocki
2026-06-03 23:06 ` Dave Jiang
2026-06-03 17:57 ` Rafael J. Wysocki [this message]
2026-06-03 23:07 ` [PATCH v2 3/4] ACPI: NFIT: core: Eliminate redundant local variable Dave Jiang
2026-06-03 17:58 ` [PATCH v2 4/4] ACPI: NFIT: core: Fix possible deadlock and missing notifications Rafael J. Wysocki
2026-06-03 23:10 ` Dave Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14028918.uLZWGnKmhe@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=alison.schofield@intel.com \
--cc=chenxiang66@hisilicon.com \
--cc=dave.jiang@intel.com \
--cc=djbw@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
--cc=vishal.l.verma@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®