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: 3645301 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CDA4A9F334 for ; Thu, 13 Feb 2014 13:16:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CCC7201D5 for ; Thu, 13 Feb 2014 13:16:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16BB72010E for ; Thu, 13 Feb 2014 13:16:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754475AbaBMNQv (ORCPT ); Thu, 13 Feb 2014 08:16:51 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:42901 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753284AbaBMNQv (ORCPT ); Thu, 13 Feb 2014 08:16:51 -0500 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 CC: Russell King , David Airlie , , Benjamin Herrenschmidt , , , , Yijing Wang , Hanjun Guo 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 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