From patchwork Fri Aug 17 23:36:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1340201 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5FC043FC81 for ; Fri, 17 Aug 2012 23:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758155Ab2HQXg7 (ORCPT ); Fri, 17 Aug 2012 19:36:59 -0400 Received: from mail-ob0-f202.google.com ([209.85.214.202]:51044 "EHLO mail-ob0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758070Ab2HQXg6 (ORCPT ); Fri, 17 Aug 2012 19:36:58 -0400 Received: by mail-ob0-f202.google.com with SMTP id wc20so3011055obb.1 for ; Fri, 17 Aug 2012 16:36:57 -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=Bygw7TFTBfqyQv26ASlB166zqY/gU2ssRw+E+dwzHDk=; b=Xu6qeuBpZQ9YNIZEoTb3w0n+YbpvHUJILJr4jB5wzjJ/eRjRbt1iTH3GD+DvDBMPnC hugb7svem8EQfILVg0TVlWwQD4uYo84kVc8Zco7MCR+zUxOlDCtbPVQL2x4Z+QQ4O8Jh 7sy8njq2CVre32D9x8fcsoMzrDfwRTt43kTVHieg+sO/EeOtUAQy7emqH0KPUTZnKncH hyFTvurbtlDydavyISOoKFn+3X+W9jdeGGCrB2h4dcucHH+2/g7WMaU2sk7qkvKAaGNg 0Y+ZuUQfHCkK19bRV9UOsjbC0cf8FOWQI19dE0qdr0iMEiBwICmLPGp2DiEkO5FYVJWx Vz0A== X-Google-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 :x-gm-message-state; bh=Bygw7TFTBfqyQv26ASlB166zqY/gU2ssRw+E+dwzHDk=; b=O1e/Q9r8guCBGkbocSBZ10r7qLr6BYcceOS9s0p4a1nj5xug2EYPJJcqeFCGYgdNdy xO4TAC8tn+9oVAtCeFXH89CGltOkUFr/gWk19JtEbKA/zbijk6nnk29WHosmt80ROHNq ThHi/DaeikhIrfTMtwd4udXOMreAmPNdsZEWDq8MwDmltJiHheLi6GPTgVSck3aIExBf 9c8508mNY1dh44ECPev2UypxaZQwlyVNp322pWR1ROt3BjuhFgjbRnX3EFAEXTrx+hXn hyC0lrDBNzIgwuUVhUh26nHpI1914r/Kp3kUrXEIkx15yFt1D9XYrYk7XyIGVdPnMEeP qYuQ== Received: by 10.50.217.134 with SMTP id oy6mr1612116igc.5.1345246617761; Fri, 17 Aug 2012 16:36:57 -0700 (PDT) Received: by 10.50.217.134 with SMTP id oy6mr1612110igc.5.1345246617682; Fri, 17 Aug 2012 16:36:57 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id mb9si1823289igc.1.2012.08.17.16.36.57 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 17 Aug 2012 16:36:57 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 4C4F81E0043; Fri, 17 Aug 2012 16:36:57 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id EDD431801BB; Fri, 17 Aug 2012 16:36:56 -0700 (PDT) Subject: [PATCH v2 14/16] parisc/PCI: Use list_for_each_entry() for bus->devices traversal To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-pcmcia@lists.infradead.org, Yinghai Lu , linux-parisc@vger.kernel.org, Kenji Kaneshige Date: Fri, 17 Aug 2012 17:36:56 -0600 Message-ID: <20120817233656.10973.65389.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20120817233100.10973.59521.stgit@bhelgaas.mtv.corp.google.com> References: <20120817233100.10973.59521.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQllYotSOvRjHvrq7QiNjlVFM6tx8QBrC/r/VXtDE8hmeDexhu6GVDbTiHFLxjrywZp7zxg7Pbr9hwIUzurpNsuu40e9Vjp9Bddo4IdXpWV9kTjh+gO//n4seXq0J42i29vJZ1GoXH629FsOK7zxMUyh1ZYmBOEkdc/WXUasTR3WcJ0YwwtITVOAxNiiD84ltOLu9hrzLvcOMq7tk2aQSv9AbCP2BA== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Replace list_for_each() + pci_dev_b() with the simpler list_for_each_entry(). Signed-off-by: Bjorn Helgaas CC: linux-parisc@vger.kernel.org --- drivers/parisc/dino.c | 6 ++---- drivers/parisc/lba_pci.c | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" 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/parisc/dino.c b/drivers/parisc/dino.c index ffddc4f..4581ee0 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c @@ -477,14 +477,12 @@ dino_card_setup(struct pci_bus *bus, void __iomem *base_addr) if (ccio_allocate_resource(dino_dev->hba.dev, res, _8MB, F_EXTEND(0xf0000000UL) | _8MB, F_EXTEND(0xffffffffUL) &~ _8MB, _8MB) < 0) { - struct list_head *ln, *tmp_ln; + struct pci_dev *dev, *tmp; printk(KERN_ERR "Dino: cannot attach bus %s\n", dev_name(bus->bridge)); /* kill the bus, we can't do anything with it */ - list_for_each_safe(ln, tmp_ln, &bus->devices) { - struct pci_dev *dev = pci_dev_b(ln); - + list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) { list_del(&dev->bus_list); } diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 4ce57c9..fdd63a6 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c @@ -629,7 +629,6 @@ truncate_pat_collision(struct resource *root, struct resource *new) static void lba_fixup_bus(struct pci_bus *bus) { - struct list_head *ln; struct pci_dev *dev; #ifdef FBB_SUPPORT u16 status; @@ -711,10 +710,9 @@ lba_fixup_bus(struct pci_bus *bus) } - list_for_each(ln, &bus->devices) { + list_for_each_entry(dev, &bus->devices, bus_list) { int i; - dev = pci_dev_b(ln); DBG("lba_fixup_bus() %s\n", pci_name(dev)); /* Virtualize Device/Bridge Resources. */ @@ -771,8 +769,7 @@ lba_fixup_bus(struct pci_bus *bus) } /* Lastly enable FBB/PERR/SERR on all devices too */ - list_for_each(ln, &bus->devices) { - dev = pci_dev_b(ln); + list_for_each_entry(dev, &bus->devices, bus_list) { (void) pci_read_config_word(dev, PCI_COMMAND, &status); status |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR | fbb_enable; (void) pci_write_config_word(dev, PCI_COMMAND, status);