From patchwork Thu Aug 2 06:33:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oceanhe@zoho.com.cn X-Patchwork-Id: 10553277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4CB0214E2 for ; Thu, 2 Aug 2018 06:49:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E00D2A6E5 for ; Thu, 2 Aug 2018 06:49:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307152A72B; Thu, 2 Aug 2018 06:49:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B39512A6E5 for ; Thu, 2 Aug 2018 06:49:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726192AbeHBIjN (ORCPT ); Thu, 2 Aug 2018 04:39:13 -0400 Received: from sender2-pp-o92.zoho.com.cn ([163.53.93.251]:25910 "EHLO sender1.zoho.com.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726145AbeHBIjN (ORCPT ); Thu, 2 Aug 2018 04:39:13 -0400 X-Greylist: delayed 935 seconds by postgrey-1.27 at vger.kernel.org; Thu, 02 Aug 2018 04:39:12 EDT Received: from localhost.localdomain.localdomain (45.62.52.41 [45.62.52.41]) by mx.zoho.com.cn with SMTPS id 1533191606755967.5943860410273; Thu, 2 Aug 2018 14:33:26 +0800 (CST) 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 Subject: [PATCH] ACPI: nfit: remove redundant assignment if nfit_mem found Date: Thu, 2 Aug 2018 02:33:11 -0400 Message-Id: <1533191591-20453-1-git-send-email-oceanhe@zoho.com.cn> X-Mailer: git-send-email 1.8.3.1 X-ZohoCNMailClient: External Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ocean He 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 --- 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)