mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	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>,
	nvdimm@lists.linux.dev,
	Alison Schofield <alison.schofield@intel.com>,
	Xiang Chen <chenxiang66@hisilicon.com>
Subject: Re: [PATCH v2 3/4] ACPI: NFIT: core: Eliminate redundant local variable
Date: Wed, 3 Jun 2026 16:07:35 -0700	[thread overview]
Message-ID: <1909af0f-8f06-4555-a5f5-f309ee60fcfa@intel.com> (raw)
In-Reply-To: <14028918.uLZWGnKmhe@rafael.j.wysocki>



On 6/3/26 10:57 AM, Rafael J. Wysocki wrote:
> 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>

Reviewed-by: Dave Jiang <dave.jiang@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);


  reply	other threads:[~2026-06-03 23:07 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 ` [PATCH v2 3/4] ACPI: NFIT: core: Eliminate redundant local variable Rafael J. Wysocki
2026-06-03 23:07   ` Dave Jiang [this message]
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=1909af0f-8f06-4555-a5f5-f309ee60fcfa@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=chenxiang66@hisilicon.com \
    --cc=djbw@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=rafael@kernel.org \
    --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®