From patchwork Wed Aug 21 23:39:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 2847957 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 898ADBF546 for ; Wed, 21 Aug 2013 23:39:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7B3A205C8 for ; Wed, 21 Aug 2013 23:39:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4186205B9 for ; Wed, 21 Aug 2013 23:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752936Ab3HUXjk (ORCPT ); Wed, 21 Aug 2013 19:39:40 -0400 Received: from mail-ob0-f172.google.com ([209.85.214.172]:35472 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369Ab3HUXjj (ORCPT ); Wed, 21 Aug 2013 19:39:39 -0400 Received: by mail-ob0-f172.google.com with SMTP id er7so2246903obc.3 for ; Wed, 21 Aug 2013 16:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=mlPTB29gbTcfkYaRBOF3bu3OvgPn2/3gTtyz32HV4/I=; b=g5kjsr5XZmG/qo/NkqgYp1i2tfyi71O+0617Tmb1YWwbnvgo0JG17BV3GhsUy2Mva2 46NEddssFEbFkmKZ79Dbq+FXp8UvpAfNb9E8Zh9ExkpDmZN8fG8bR0FOBnPcVk+hdmYE ZX5Zad+4Af6BDse38g0hg2NVT4mOPnJkxukOpROieojdEt/sFV6CpzQnZqgDc6CB1SP0 ggLrmuKGUU3BEhqZcWvR7cRDOEMd4noswrg36r1z83oUIbxaSRX2lv6WwYJR+ptxOWcj MVQEUQeSXPkt+D9VyDfhic8k1hQYinhBkNrjV3Xt7pq3xmjxun28k7taFfb5qIyKxNl+ He+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=mlPTB29gbTcfkYaRBOF3bu3OvgPn2/3gTtyz32HV4/I=; b=nkcTmV6USqH6GFoDmMATZFj0IQTtJqVQ0xujTfijkETRymEe6wQNHVcXB60C6oq6TK fRXSzwWFcws6Vg+ioJasEY2fYDHkZa/DfYXJBHKu7IWKtxJFc4y4ITLP9UZshec78l55 CNVZt0cNNPXTq1DJJb7+59AitCNQkv0gcGFYSK9XLPjCCmKgB1s5koMAVNH9bt7Gz2KF e0PWyXecXZV+Gnc28HqjyoDxX2p6OBysJoEfj82F6vCYAy6pvELHZCNS0/ZJ74IoNNI2 cfv9lfsKalkvypZwr5JAq+eTfFE76hkozKpfjXEbShr831Expt9CkWLNPVxEbdRxbcyE nWMA== X-Gm-Message-State: ALoCoQkOJCXS+/jmeYHARzpmsWdmJIARVuv+I3RHMV3BqhdyM9HXs84R2/HNLOZyRmSysW6lPkRrtYjI0eUjgkn8aaAyI4hIRqsiie4e5V0hsTJuAzZuBgFG8CLubsRRAJl6NbTjfDgzwqwQ9Z/Z9KvnTHmTXSiRX2D4sIRAbOGr4u80JH1khEZTqKQMuX1Q5piEhPMiqWzjLLKYJsy+R2f9Fgvsa3y3Nw== X-Received: by 10.60.40.34 with SMTP id u2mr4704585oek.91.1377128379350; Wed, 21 Aug 2013 16:39:39 -0700 (PDT) Received: from localhost ([172.29.122.86]) by mx.google.com with ESMTPSA id s14sm14010544oeo.1.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 Aug 2013 16:39:38 -0700 (PDT) Subject: [PATCH v7 4/5] PCI: Simplify MPS test for Downstream Port To: Yijing Wang From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Jon Mason , jiang.liu@huawei.com, Hanjun Guo Date: Wed, 21 Aug 2013 17:39:36 -0600 Message-ID: <20130821233936.2300.53720.stgit@bhelgaas-glaptop> In-Reply-To: <20130821233722.2300.81773.stgit@bhelgaas-glaptop> References: <20130821233722.2300.81773.stgit@bhelgaas-glaptop> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP PCIe hotplug bridges are always either Root Ports or Downstream Ports. No other device type can have a PCIe link leading downstream to a slot. Root Ports don't have an upstream bridge, so "dev->is_hotplug_bridge && dev->bus->self" is true if and only if "dev" is a Downstream Port. That means we can simplify this by looking at the type of "dev" itself, without looking upstream at all. No functional change. Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index ecae7f2..0591b08 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1507,8 +1507,7 @@ static int pcie_find_smpss(struct pci_dev *dev, void *data) * will occur as normal. */ if (dev->is_hotplug_bridge && (!list_is_singular(&dev->bus->devices) || - (dev->bus->self && - pci_pcie_type(dev->bus->self) != PCI_EXP_TYPE_ROOT_PORT))) + pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT)) *smpss = 0; if (*smpss > dev->pcie_mpss)