nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: oceanhehy@gmail.com
To: dan.j.williams@intel.com, ross.zwisler@linux.intel.com,
	vishal.l.verma@intel.com, dave.jiang@intel.com,
	rjw@rjwysocki.net, lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, Ocean He <hehy1@lenovo.com>,
	linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org
Subject: [PATCH v2] ACPI: nfit: remove redundant assignment if nfit_mem found
Date: Thu,  2 Aug 2018 04:44:04 -0400	[thread overview]
Message-ID: <1533199444-29607-1-git-send-email-oceanhehy@gmail.com> (raw)

From: Ocean He <hehy1@lenovo.com>

When nfit_mem is found via list_for_each_entry, it has already been
assigned valid value. There is no need to assign it again in the following

Signed-off-by: Ocean He <hehy1@lenovo.com>
v1: https://patchwork.kernel.org/patch/10553277/
v2: Sorry for noise. I got an email problem, so I have to resend to loop 

 drivers/acpi/nfit/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 7c47900..85dde54 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -1048,9 +1048,7 @@ static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc,
-		if (found)
-			nfit_mem = found;
-		else {
+		if (!found) {
 			nfit_mem = devm_kzalloc(acpi_desc->dev,
 					sizeof(*nfit_mem), GFP_KERNEL);
 			if (!nfit_mem)

Linux-nvdimm mailing list

             reply	other threads:[~2018-08-02  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-02  8:44 oceanhehy [this message]
2018-08-10 23:45 ` [PATCH v2] ACPI: nfit: remove redundant assignment if nfit_mem found Verma, Vishal L
2018-08-13  2:53   ` [External] " Ocean HY1 He

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533199444-29607-1-git-send-email-oceanhehy@gmail.com \
    --to=oceanhehy@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=hehy1@lenovo.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rjw@rjwysocki.net \
    --cc=ross.zwisler@linux.intel.com \
    --cc=vishal.l.verma@intel.com \


* 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;
as well as URLs for NNTP newsgroup(s).