lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1533191591-20453-1-git-send-email-oceanhe@zoho.com.cn>
Date:   Thu,  2 Aug 2018 02:33:11 -0400
From:   oceanhe@...o.com.cn
To:     dan.j.williams@...el.com, ross.zwisler@...ux.intel.com,
        vishal.l.verma@...el.com, dave.jiang@...el.com, rjw@...ysocki.net,
        lenb@...nel.org
Cc:     linux-nvdimm@...ts.01.org, linux-acpi@...r.kernel.org,
        linux-kernel@...r.kernel.org, Ocean He <hehy1@...ovo.com>
Subject: [PATCH] ACPI: nfit: remove redundant assignment if nfit_mem found

From: Ocean He <hehy1@...ovo.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@...ovo.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ