From patchwork Fri Mar 14 09:34:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 3831851 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 24459BF540 for ; Fri, 14 Mar 2014 09:35:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52B5E2026C for ; Fri, 14 Mar 2014 09:35:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF55B20320 for ; Fri, 14 Mar 2014 09:35:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755971AbaCNJfK (ORCPT ); Fri, 14 Mar 2014 05:35:10 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:33045 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755770AbaCNJfH (ORCPT ); Fri, 14 Mar 2014 05:35:07 -0400 Received: from 172.24.2.119 (EHLO szxeml214-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ALW82123; Fri, 14 Mar 2014 17:35:03 +0800 (CST) Received: from SZXEML424-HUB.china.huawei.com (10.82.67.163) by szxeml214-edg.china.huawei.com (172.24.2.29) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 14 Mar 2014 17:35:00 +0800 Received: from localhost (10.177.27.212) by szxeml424-hub.china.huawei.com (10.82.67.163) with Microsoft SMTP Server id 14.3.158.1; Fri, 14 Mar 2014 17:34:52 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , "Rafael J. Wysocki" , Yijing Wang Subject: [PATCH 2/3] PCI: Refactor pci_is_bridge() Date: Fri, 14 Mar 2014 17:34:51 +0800 Message-ID: <1394789691-13512-1-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.177.27.212] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Refactor pci_is_bridge(), check pci device hdr_type instead, and move it in include/linux/pci.h Signed-off-by: Yijing Wang --- include/linux/pci.h | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index 33aa2ca..22370c4 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev) return pci_pcie_cap(dev); } +static inline bool pci_is_bridge(struct pci_dev *dev) +{ + return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || + dev->hdr_type == PCI_HEADER_TYPE_CARDBUS; +} + /** * pcie_caps_reg - get the PCIe Capabilities Register * @dev: PCI device