From: oceanhe@zoho.com.cn
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-nvdimm@lists.01.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, Ocean He <hehy1@lenovo.com>
Subject: [PATCH] ACPI: nfit: remove redundant assignment if nfit_mem found
Date: Thu, 2 Aug 2018 02:33:11 -0400 [thread overview]
Message-ID: <1533191591-20453-1-git-send-email-oceanhe@zoho.com.cn> (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
codes.
Signed-off-by: Ocean He <hehy1@lenovo.com>
---
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,
break;
}
- if (found)
- nfit_mem = found;
- else {
+ if (!found) {
nfit_mem = devm_kzalloc(acpi_desc->dev,
sizeof(*nfit_mem), GFP_KERNEL);
if (!nfit_mem)
--
1.8.3.1
reply other threads:[~2018-08-02 6:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1533191591-20453-1-git-send-email-oceanhe@zoho.com.cn \
--to=oceanhe@zoho.com.cn \
--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 \
/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;
as well as URLs for NNTP newsgroup(s).