From patchwork Thu Aug 2 08:44:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ocean He X-Patchwork-Id: 10553363 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 8AD7613BF for ; Thu, 2 Aug 2018 08:44:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C088293C1 for ; Thu, 2 Aug 2018 08:44:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 701F829495; Thu, 2 Aug 2018 08:44:18 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35BBE293C1 for ; Thu, 2 Aug 2018 08:44:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B10FF210D6CE9; Thu, 2 Aug 2018 01:44:17 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400d:c09::241; helo=mail-qk0-x241.google.com; envelope-from=oceanhehy@gmail.com; receiver=linux-nvdimm@lists.01.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 94EC9210D6CE2 for ; Thu, 2 Aug 2018 01:44:15 -0700 (PDT) Received: by mail-qk0-x241.google.com with SMTP id c126-v6so1000272qkd.7 for ; 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=Gr8LloSG5nkQPbB/RxCQxf2bmN5cDmjvDXN496V4WMHPiveguLiPQ/B5kenFqg4sRQ 6NRYv6R0XpnaK5MBndWwWHk2VlXvzDqhZ7xQX1smMqs912U1BrvBOMcYKZQZiEG/pQpT idY1fYzhgQeWCuP9GqlGIpNDEZfHggSYXAY+yhZrbjd1ENDNYGAIkfQlag0NHuMl/wd9 EYKrai/fLfIkL8xO6XgKe4LjcU6kvSa9Nkbl91ESFxMBmzy+8mcTfeqa0D6VXRIxUCBQ ucEEQzEiKXKogrXgbydNkKY/4WHHmO6yH3G67Bb0Gria6cUbCu+F4sRz9n2dVl8Af+Ut nU6Q== X-Gm-Message-State: AOUpUlEoRF4Ln9JWf5aBqKcV4+/S44Cw71TeprqMedwbpH02g6qu3seO 0KCyzQuEb4k8dR2awRU7Znk= X-Google-Smtp-Source: AAOMgpexuBvXZFN1KXu1jNzdDXjUYvRKvgfG7d+RYv8Hx/GUxsJgO61P0lkH/3urGmDAdew/4tMfTw== 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 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 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-acpi@vger.kernel.org, Ocean He , linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" 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 --- 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)