From patchwork Thu Feb 13 13:14:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 3645911 Return-Path: X-Original-To: patchwork-dri-devel@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 B1BDBBF40C for ; Thu, 13 Feb 2014 15:06:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3C5F2013A for ; Thu, 13 Feb 2014 15:06:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 19B1420158 for ; Thu, 13 Feb 2014 15:06:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98AA510584C; Thu, 13 Feb 2014 07:06:08 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by gabe.freedesktop.org (Postfix) with ESMTP id 85F1EFAD60 for ; Thu, 13 Feb 2014 05:15:11 -0800 (PST) Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AKO65130; Thu, 13 Feb 2014 21:14:26 +0800 (CST) Received: from SZXEML452-HUB.china.huawei.com (10.82.67.195) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.3.158.1; Thu, 13 Feb 2014 21:14:22 +0800 Received: from localhost (10.177.27.212) by szxeml452-hub.china.huawei.com (10.82.67.195) with Microsoft SMTP Server id 14.3.158.1; Thu, 13 Feb 2014 21:14:17 +0800 From: Yijing Wang To: Bjorn Helgaas Subject: [PATCH 5/6] PCI/pcmcia: Use list_for_each_entry() for bus traversal Date: Thu, 13 Feb 2014 21:14:02 +0800 Message-ID: <1392297243-61848-5-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 In-Reply-To: <1392297243-61848-1-git-send-email-wangyijing@huawei.com> References: <1392297243-61848-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.27.212] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Thu, 13 Feb 2014 07:06:00 -0800 Cc: Russell King , linux-pcmcia@lists.infradead.org, Hanjun Guo , dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, Yijing Wang , linuxppc-dev@lists.ozlabs.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Replace list_for_each() + pci_bus_b() with the simpler list_for_each_entry(). Signed-off-by: Yijing Wang --- drivers/pcmcia/yenta_socket.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 8485761..d16fb12 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -1076,7 +1076,7 @@ static void yenta_config_init(struct yenta_socket *socket) */ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) { - struct list_head *tmp; + struct pci_bus *silbling; unsigned char upper_limit; /* * We only check and fix the parent bridge: All systems which need @@ -1096,8 +1096,8 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) upper_limit = bridge_to_fix->parent->busn_res.end; /* check the bus ranges of all silbling bridges to prevent overlap */ - list_for_each(tmp, &bridge_to_fix->parent->children) { - struct pci_bus *silbling = pci_bus_b(tmp); + list_for_each_entry(silbling, &bridge_to_fix->parent->children, + node) { /* * If the silbling has a higher secondary bus number * and it's secondary is equal or smaller than our