From patchwork Wed Sep 5 20:35:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10589453 X-Patchwork-Delegate: bhelgaas@google.com 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 356E513BB for ; Wed, 5 Sep 2018 20:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2718C2ABB0 for ; Wed, 5 Sep 2018 20:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19BF82ABB8; Wed, 5 Sep 2018 20:39:24 +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 BF2732ABB0 for ; Wed, 5 Sep 2018 20:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbeIFBLO (ORCPT ); Wed, 5 Sep 2018 21:11:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:26907 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbeIFBLO (ORCPT ); Wed, 5 Sep 2018 21:11:14 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Sep 2018 13:39:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,334,1531810800"; d="scan'208";a="260165820" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga005.fm.intel.com with ESMTP; 05 Sep 2018 13:39:21 -0700 From: Keith Busch To: Linux PCI , Bjorn Helgaas Cc: Benjamin Herrenschmidt , Sinan Kaya , Thomas Tai , poza@codeaurora.org, Lukas Wunner , Christoph Hellwig , Keith Busch Subject: [PATCHv2 19/20] PCI/DPC: Link reset code cleanup Date: Wed, 5 Sep 2018 14:35:45 -0600 Message-Id: <20180905203546.21921-20-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180905203546.21921-1-keith.busch@intel.com> References: <20180905203546.21921-1-keith.busch@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is just a code clean up patch reording declarations based on their dependency. No functional change here. Signed-off-by: Keith Busch --- drivers/pci/pcie/dpc.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 0aa0d01562bf..25d1b1445484 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -66,24 +66,15 @@ static int dpc_wait_rp_inactive(struct dpc_dev *dpc) static pci_ers_result_t dpc_reset_link(struct pci_dev *pdev) { - struct dpc_dev *dpc; - struct pcie_device *pciedev; - struct device *devdpc; - - u16 cap; - - /* - * DPC disables the Link automatically in hardware, so it has - * already been reset by the time we get here. - */ - devdpc = pcie_port_find_device(pdev, PCIE_PORT_SERVICE_DPC); - pciedev = to_pcie_device(devdpc); - dpc = get_service_data(pciedev); - cap = dpc->cap_pos; + struct device *devdpc = pcie_port_find_device(pdev, PCIE_PORT_SERVICE_DPC); + struct pcie_device *pciedev = to_pcie_device(devdpc); + struct dpc_dev *dpc = get_service_data(pciedev); + u16 cap = dpc->cap_pos; /* - * Wait until the Link is inactive, then clear DPC Trigger Status - * to allow the Port to leave DPC. + * DPC disables the Link automatically in hardware, so it has already + * been reset by the time we get here. Wait until the Link is inactive, + * then clear DPC Trigger Status to allow the Port to leave DPC. */ pcie_wait_for_link(pdev, false);