From patchwork Wed Aug 8 14:50:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ocean He X-Patchwork-Id: 10560133 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 72AB91390 for ; Wed, 8 Aug 2018 14:50:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E2F62AFA7 for ; Wed, 8 Aug 2018 14:50:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C6602AFAB; Wed, 8 Aug 2018 14:50:37 +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 EBE912AF5B for ; Wed, 8 Aug 2018 14:50:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A82D4210E129A; Wed, 8 Aug 2018 07:50:36 -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:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=oceanhehy@gmail.com; receiver=linux-nvdimm@lists.01.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (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 07AB9210E1292 for ; Wed, 8 Aug 2018 07:50:35 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id j8-v6so1259639pff.6 for ; Wed, 08 Aug 2018 07:50:35 -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=+fylNTi5bV/DGFZ7AukNnDfwVutWQ/BlHQxVLJ9/vF8=; b=Pv6eXifOUJCF9UnapaP1yC6KPsuC336mb9LDrxALwe/KWKQTyEjNVr/zZDpzsPR6SR XSOeH3y3bHZnfWP3H8tPKT5tTxdBY55uQXRVkHA79vrZwBwANglmQ4b04FJNNPYs2tnB SRc/yHvLmueq+/s0hjh/2HC4fuyAwoVPskJkaU84VzWcnMWu8zkUD9qx2QIi94Pp/Eky LtpfOfs62keZkcbOlRuqK1Df+S4dEpkpYAb3epRDPMeAOfyEEJF1M/lAEKnSf48j326b Up9LqpaliSf21u1n9c5rPlSYMcEG1G86yT15UhJHsE9ZqhXwwMhplX8BDxhaMtruAksk 5njQ== 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=+fylNTi5bV/DGFZ7AukNnDfwVutWQ/BlHQxVLJ9/vF8=; b=rFl7C5xZXw/iAeq7SSXwc3azB3IgSqt5q6RR6uBVZH7Eik+agX6oo3LLEhRsFltqGN 2GNkAdrcqfoHF6yAagBGkGDT7RKnA2lUKivCHsBje7G0vsZamE7rikk8aG69uifKCiOD IdhrIhgeZ73smMi8rVMknDuieVX/Pyj75EsKXMuC19FkHCw0Q1q47XcU2bxvSvuQx6qf XcS73WuJVr09uaZKfu3e+W/Vg9ylYltSMQblIvgtbmjw2LoM4W5myFZTAqM5El27ugGz KcurzNi2kCPDcE6xJCTdA2XQZcc4jymQxrVyWTWy9ziIJlDxNM6jMbJuIpTeTAmmUz0X wtyw== X-Gm-Message-State: AOUpUlGUzD+Bpe6R/AsgciVEZoVLPiXAS06kosCyHxt4nLxjlmSW3Eqr 7zZtruyPoEKUoMCNxl72ehA= X-Google-Smtp-Source: AA+uWPzP43ejApH+edsVrevG4j+Vk8P3cUZx3h9Q6zcnhvswzCeZwqI9Nx+4Fk3x0ndq9g9pfgEQnw== X-Received: by 2002:a62:c4c3:: with SMTP id h64-v6mr3285220pfk.39.1533739835634; Wed, 08 Aug 2018 07:50:35 -0700 (PDT) Received: from 192.168.190.131 ([45.62.52.60]) by smtp.gmail.com with ESMTPSA id x2-v6sm8220854pfi.166.2018.08.08.07.50.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 07:50:35 -0700 (PDT) From: Ocean He 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] ACPI: nfit: check dcr immediately following its assignment codes Date: Wed, 8 Aug 2018 10:50:21 -0400 Message-Id: <1533739821-9864-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 In commit 6697b2cf69d43632 ("nfit: fix multi-interface dimm handling, acpi6.1 compatibility"), the check codes of dcr were just following its assignment codes. But they were separated by commit ad9ac5e1957531a8 ("nfit: always associate flush hints"). Just change the check codes back to original position, without function change. Signed-off-by: Ocean He --- drivers/acpi/nfit/core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 7c47900..c9e4c9a 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1078,6 +1078,12 @@ static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc, break; } + if (dcr && !nfit_mem->dcr) { + dev_err(acpi_desc->dev, "SPA %d missing DCR %d\n", + spa->range_index, dcr); + return -ENODEV; + } + list_for_each_entry(nfit_flush, &acpi_desc->flushes, list) { struct acpi_nfit_flush_address *flush; u16 i; @@ -1101,12 +1107,6 @@ static int __nfit_mem_init(struct acpi_nfit_desc *acpi_desc, break; } - if (dcr && !nfit_mem->dcr) { - dev_err(acpi_desc->dev, "SPA %d missing DCR %d\n", - spa->range_index, dcr); - return -ENODEV; - } - if (type == NFIT_SPA_DCR) { struct nfit_idt *nfit_idt; u16 idt_idx;