Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1839838imm; Thu, 2 Aug 2018 01:46:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcQzk0AprLoRMYoNWDfhAJXo8RuhwHh17W7Cxv7ycz70B/1RiAIzzaWAztp90U2KEYjbSR3 X-Received: by 2002:a63:dd49:: with SMTP id g9-v6mr472931pgj.356.1533199568813; Thu, 02 Aug 2018 01:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533199568; cv=none; d=google.com; s=arc-20160816; b=OQHrumobf1zMMz6xWaJQk0RUvwkSH6Mw1NuiJQ+LKHpqjplRjU74qK5m1FrAFQuneL ChwLca6RoqwM5GR/Bct0iM1CWyQBSbxYJop93W85WXGadw/W+nAMCdmRe13NnS4HFJIL ozrOWnybVr63XZJ5rT/mBbQvkHquRHLg4rPueyxDrUG1L7wex9pnZotwKANVBOs1iiL/ ehApL8Y2p0Qk8QVRDBp2DTxFI8eOZMjNzFAivuf3Uim/1BdNknxdtmm7Pkzh2i44FaPv 7Td4hfDkTInDuY+dYW3/q+7gjkjucyixA1Nm98vFkeuvLxtRSY2bFun9Y8HSTqtlC3bd 6MNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=L0QuFqGTDC7c3vLAvTOolp2gyhmIHADwyhlDFdB+fHg=; b=UsQt7ZfhljckZTkMqZwnh6R1rtD5Hn9z6T3O3o8AQDWp7jOG9KiZW0y4QuHcMHz2IC kMP6+Cj2b3ooVZGn1XaRBbBlhjbeQ6BRONWADcrSwCQPIgl2TKR3JbnkimXs8XRg9IUl bN7UPQ5lUEJReg4ziYabpM+WABzq93dI69NK5Z0O0jAr3gdyQqnb43hq9dVMjy3SP6D1 F9TKSRBKd4jfUe9P/p3u+c7mM/ed6yb1HMvm97PUeEPLocrtIFUVKoyCu3i4MGULf5sB xmgpwNHttnB/C+yDSME1At/9O1eo3CXzQ1rJdamTGI9r99mLkx+bx6BXZaTxs/7riMC5 B2iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GmBfVE+/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10-v6si1524058pgh.310.2018.08.02.01.45.54; Thu, 02 Aug 2018 01:46:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GmBfVE+/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729899AbeHBKeX (ORCPT + 99 others); Thu, 2 Aug 2018 06:34:23 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:35280 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbeHBKeX (ORCPT ); Thu, 2 Aug 2018 06:34:23 -0400 Received: by mail-qk0-f195.google.com with SMTP id u21-v6so1026319qku.2; Thu, 02 Aug 2018 01:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=L0QuFqGTDC7c3vLAvTOolp2gyhmIHADwyhlDFdB+fHg=; b=GmBfVE+/rZxssXpqqODlL8SDcFLgwjYdmLRLWQnp8pnmsluSemGJHsefk4LgLX30+J p8a8Z9oQL8zC7isu01fkRZPpgByIL0o+DKoyIuXBCHDIMBin9y395PHHPAFa9GDiHkOV p8DUJYGyDXuhYc8H/Tp1ewnJl96wOJvSJ7if0uWJA4WEgDxTDqYnQniYbhLDZ5Pufqp4 1ReGS/9ts2gkmTRMr32cqm+oAlv1kl1IodwPc1M1JVrEUDcEPuIRXC+nf5bBlo1T8btj 6EhFFYIIgWw0ENnX5jsOmNKYV03Q92WGUGpnKAWN51JuzoMJsaSkLpEskD9pV3iXSxLh osAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=L0QuFqGTDC7c3vLAvTOolp2gyhmIHADwyhlDFdB+fHg=; b=ivV9z8KQAUSswa8LKaz4NAxBGTWncNB9NA7d/52aipyIbwAYIhxfwhzMHLrt33bVvo flrhbnTMF2rLFEDkCydf6pi6xGNRiZaNgESxtjGlDUNjQ3UpHAUQnYED5V5JP2CoGsq8 yjFbG8hCrdkZmbeIcS/HLTRujPXQXJk+rV37w4KpkbcDFFhUZaHn5lQNAacoIvutVF1R nW9vO8Ur8VjSZT8dO/lFRRqcogRHXUzXhhhvteei8XEyS+rBhWgE9EPD3iiKSDDzXDZd UgI2T5defMqwp2x0MvZ9xVnky1VXPwIUKkM/fQ7sk+8sSDxgesPyorcEBOK9lNA4Em1j nkVg== X-Gm-Message-State: AOUpUlEkadGz1Kf79Bn1XVMlZGVcZbiKz86rDU2qE6PFbZoOju5KjF6D oHCcKFlxU8pQynuPgRTYmIs= X-Received: by 2002:a37:bd02:: with SMTP id n2-v6mr1081507qkf.336.1533199454653; Thu, 02 Aug 2018 01:44:14 -0700 (PDT) Received: from localhost.localdomain ([104.237.86.58]) by smtp.gmail.com with ESMTPSA id g39-v6sm881943qtb.47.2018.08.02.01.44.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Aug 2018 01:44:14 -0700 (PDT) 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-nvdimm@lists.01.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Ocean He Subject: [PATCH v2] ACPI: nfit: remove redundant assignment if nfit_mem found Date: Thu, 2 Aug 2018 04:44:04 -0400 Message-Id: <1533199444-29607-1-git-send-email-oceanhehy@gmail.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v1: https://patchwork.kernel.org/patch/10553277/ v2: Sorry for noise. I got an email problem, so I have to resend to loop linux-nvdimm@lists.01.org. 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