From patchwork Fri Dec 16 22:31:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 131925 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A1CA41007D7 for ; Sat, 17 Dec 2011 09:32:03 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760901Ab1LPWb5 (ORCPT ); Fri, 16 Dec 2011 17:31:57 -0500 Received: from mail-yx0-f202.google.com ([209.85.213.202]:40106 "EHLO mail-yx0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752591Ab1LPWbz (ORCPT ); Fri, 16 Dec 2011 17:31:55 -0500 Received: by mail-yx0-f202.google.com with SMTP id m5so459911yen.1 for ; Fri, 16 Dec 2011 14:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=6ydcy62NT6dyrqntbJPQoAnDWzH9oqTmU8f8FxkjxRM=; b=S/faqB/atbU+SNWtgGQks/dr78YwKA6wr0zphDOd7fbznSe+affpB++Og8tmm+uLdx QGFSW+Pj7fVCgKx+Qg1Q== Received: by 10.236.124.80 with SMTP id w56mr3023324yhh.0.1324074715476; Fri, 16 Dec 2011 14:31:55 -0800 (PST) Received: by 10.236.124.80 with SMTP id w56mr3023303yhh.0.1324074715418; Fri, 16 Dec 2011 14:31:55 -0800 (PST) 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 a35si3190371yhf.2.2011.12.16.14.31.55 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 16 Dec 2011 14:31:55 -0800 (PST) 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 503D41E004D; Fri, 16 Dec 2011 14:31:55 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id F402718273A; Fri, 16 Dec 2011 14:31:54 -0800 (PST) Subject: [PATCH 5/6] de4x5/PCI: use list_for_each_entry() for bus->devices traversal To: Jesse Barnes From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Grant Grundler , netdev@vger.kernel.org Date: Fri, 16 Dec 2011 15:31:54 -0700 Message-ID: <20111216223154.5963.39965.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20111216223043.5963.87534.stgit@bhelgaas.mtv.corp.google.com> References: <20111216223043.5963.87534.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace open-coded list traversal with list_for_each_entry(). CC: Grant Grundler CC: netdev@vger.kernel.org Signed-off-by: Bjorn Helgaas --- drivers/net/ethernet/dec/tulip/de4x5.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c index 871bcaa..3f5d3b9 100644 --- a/drivers/net/ethernet/dec/tulip/de4x5.c +++ b/drivers/net/ethernet/dec/tulip/de4x5.c @@ -2127,14 +2127,9 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) u_long iobase = 0; /* Clear upper 32 bits in Alphas */ int i, j; struct de4x5_private *lp = netdev_priv(dev); - struct list_head *walk; - - list_for_each(walk, &pdev->bus_list) { - struct pci_dev *this_dev = pci_dev_b(walk); - - /* Skip the pci_bus list entry */ - if (list_entry(walk, struct pci_bus, devices) == pdev->bus) continue; + struct pci_dev *this_dev; + list_for_each_entry(this_dev, &pdev->bus->devices, bus_list) { vendor = this_dev->vendor; device = this_dev->device << 8; if (!(is_DC21040 || is_DC21041 || is_DC21140 || is_DC2114x)) continue;