From patchwork Thu Aug 16 23:26:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1335451 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FB03DFB34 for ; Thu, 16 Aug 2012 23:33:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752372Ab2HPXdn (ORCPT ); Thu, 16 Aug 2012 19:33:43 -0400 Received: from mail-ee0-f74.google.com ([74.125.83.74]:57211 "EHLO mail-ee0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966Ab2HPXdn (ORCPT ); Thu, 16 Aug 2012 19:33:43 -0400 Received: by eekd4 with SMTP id d4so157745eek.1 for ; Thu, 16 Aug 2012 16:33:41 -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=COKTDbVxEdFu445i6h3FHSC2zjrpztUNIGBJ0q2Io0tGT324nMCo/NJRVc87jn55hD RwM3TYhhjb8xKFo9mIvqu67L+2Ft6ad0z8onejE5JVChiK+2Qctu6WDzKamiGtqf9hSm aEDSfL6DGQkPKD+D0ld/a6NgEnf4DZf5Z1zGZCz4USz5TWPS66iyj2CsLS2hh4uplJxU GFte7kwL9UwL62VPyoUUgsaSeQ1syZDBr2HWGFQ1FhYFqneJt0gNUCmqh8+c7xIF3kL3 LtBf5xzghYwTdk5M00zIWnnP8Ve5K5Pw8vnGM/1p5zmulhDGgr+ciQ97NQvCBXesNqva N3+w== 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=cvMk2l+yel2YS3uwIkTM1vpR8MSPrUERK5UjI4QaNTlD9FmyC/FoJRJSOly416bXWm Tw8g/4I/FQmA1L+E+TqsHbjztLex4QMhyT6IcfrEmgfLzZLR5B1dq/Ry96ppn9yQxsJp 2H0CWmPbiP5534lNONarcRvO6TQR+ZCF1WcPpd3m6gS2l6jiLeCaOHkjBD2BqFwxhXiX Od+e0xocyqmuxgG/y7kqSHdVfw9motjXDe+Q6+Qf53JWnfSFZ7AOmJ+fpu88JakmUepG 2lq4vQ8hmtTCuBklcW2bqQ+wEYgfDKY5pHWrcvudiS+mtY1c7pZHP1TDVSFT4d3hB/Ug bxGw== Received: by 10.14.218.199 with SMTP id k47mr2543445eep.5.1345159596826; Thu, 16 Aug 2012 16:26:36 -0700 (PDT) Received: by 10.14.218.199 with SMTP id k47mr2543438eep.5.1345159596772; Thu, 16 Aug 2012 16:26:36 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id d5si7721727eep.0.2012.08.16.16.26.36 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 16 Aug 2012 16:26:36 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 9334520004E; Thu, 16 Aug 2012 16:26:36 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 05844180640; Thu, 16 Aug 2012 16:26:36 -0700 (PDT) Subject: [PATCH 4/6] parisc/PCI: Use list_for_each_entry() for bus->devices traversal To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-parisc@vger.kernel.org Date: Thu, 16 Aug 2012 17:26:36 -0600 Message-ID: <20120816232635.3662.73917.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20120816232620.3662.90438.stgit@bhelgaas.mtv.corp.google.com> References: <20120816232620.3662.90438.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnn8bOC6g6CktML28e9FdyeT3GpMQeXrFTAgFBj5ASyupMCry60FlFoSrHn9G8oLHjIed4MEQbTOAhJKjqy8xP7cxLp9/VbGcq71ps5OJxZ4hXoZ6SoTsIVefUYIpOM+V61sN0SMS3jyMlg2wmddfiZd0LlDNPxRKoki2IoCqGwT+Wmm9yZQN8YqpMkEjS/vXzoCW4H0l5deLRUX/ybIYNMPVqEkw== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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-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/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);