From patchwork Thu Aug 16 23:26:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 178127 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C24072C0098 for ; Fri, 17 Aug 2012 09:26:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932542Ab2HPX0n (ORCPT ); Thu, 16 Aug 2012 19:26:43 -0400 Received: from mail-we0-f202.google.com ([74.125.82.202]:65276 "EHLO mail-we0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932527Ab2HPX0m (ORCPT ); Thu, 16 Aug 2012 19:26:42 -0400 Received: by mail-we0-f202.google.com with SMTP id r1so155204wey.1 for ; Thu, 16 Aug 2012 16:26: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=jrfJ6IQpS2y9O9gSXMAO8Vg7dlRNGFRq4WfleZaAkb4=; b=kRAlqbUikXxVmC4PvMiLsLbEWp3V60xm2VQA+aH4j8NlCUlpZvqs7V5HAHGrkyfMRO +gO4fW2aDWwwqqvXqcNW6Wgs2Fm5gaPwFsoBzIo5SgVGK3wtaOEiiseo4KMKGbISFn+Z jvhum75f8QcFXjNNYVZZrbETeIkBuZWPIe0nC5r3rHw8SHr3iD0LbnMMWVcSnKRP5+0F LGzGJNu9gRuSK9dkCU3WpHfctzv8FKjXjDGN92pxxZWRGDoqxXZqj2+fPaFdxy4SYzNT mw1Z+36uGJQH6L6cjyKlUvDPJ5JmrMJF9v4woigmequw5rh9zWQWVsFTN2QH7WbSuaYN Ny1Q== 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=jrfJ6IQpS2y9O9gSXMAO8Vg7dlRNGFRq4WfleZaAkb4=; b=SLxNdIp6B6zCxEOgc5t+Iti3WSQH2VOCLyX+aGRk7OTbDN2k4gap5PC0ubdF/iI51g 6pVxYtfpQPDsZQ33SZy1glCJPoEWISJuj0R+IPYDtXjEuyXkzrFqG+HYcL4QRNwVTR7Q oKdngpuVmnlvqS8UD1XXs4fBYGD2yeDt2vQ6qAuWZJ7e8XM9WDmLrYNEod3IwMVyuyLI IAVhWHbJ920icw9l+7RQGCqh/hAWvLTes7HthYh1IZW2CiL8PQZyxG/wyzuGi1/BelKa 2czXHbhV9tO/73516laglBHWV//L6gNWwsgkYt085Uu+PyZIz+iw4GiPxgPbrzuqJmzA GEOw== Received: by 10.14.179.72 with SMTP id g48mr2546524eem.2.1345159601942; Thu, 16 Aug 2012 16:26:41 -0700 (PDT) Received: by 10.14.179.72 with SMTP id g48mr2546519eem.2.1345159601888; Thu, 16 Aug 2012 16:26:41 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id 46si7714745eed.1.2012.08.16.16.26.41 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 16 Aug 2012 16:26:41 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id AEA9A5C0050; Thu, 16 Aug 2012 16:26:41 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 1E947180640; Thu, 16 Aug 2012 16:26:41 -0700 (PDT) Subject: [PATCH 5/6] sgi-agp: Use list_for_each_entry() for bus->devices traversal To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: David Airlie Date: Thu, 16 Aug 2012 17:26:41 -0600 Message-ID: <20120816232641.3662.52757.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: ALoCoQlbrFMWcfnN9MI5tM2gPT+p+Glzu5JWTegtZPM2ItbVMa6igbkgTzMLs1KDSmQkEAwxbpype03AV7Bu4xh+LG32VMaDVNlxpVyZ2WANxDqdNsC/oXDGjF3nDsj/yjUyn4iUGmLtbdIXmC2WWln32fTFv9iGtmdUvTgOVI/zvtcCxwaPtp0dydYxZ+BBhb6fdecXMfn9AalWqGW1jH2xfzaywZxJmA== 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: David Airlie --- drivers/char/agp/sgi-agp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 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/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c index 1920003..3a5af2f 100644 --- a/drivers/char/agp/sgi-agp.c +++ b/drivers/char/agp/sgi-agp.c @@ -289,12 +289,11 @@ static int __devinit agp_sgi_init(void) j = 0; list_for_each_entry(info, &tioca_list, ca_list) { - struct list_head *tmp; if (list_empty(info->ca_devices)) continue; - list_for_each(tmp, info->ca_devices) { + list_for_each_entry(pdev, info->ca_devices, bus_list) { u8 cap_ptr; - pdev = pci_dev_b(tmp); + if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8)) continue; cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);