From patchwork Fri Aug 17 23:37:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1340221 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 164EA3FC81 for ; Fri, 17 Aug 2012 23:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757918Ab2HQXhF (ORCPT ); Fri, 17 Aug 2012 19:37:05 -0400 Received: from mail-wg0-f74.google.com ([74.125.82.74]:63065 "EHLO mail-wg0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755211Ab2HQXhE (ORCPT ); Fri, 17 Aug 2012 19:37:04 -0400 Received: by wgbdt11 with SMTP id dt11so206518wgb.1 for ; Fri, 17 Aug 2012 16:37:02 -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=P+TMiFSpgu7qcttQrnDNMgalQHbcxuJzNDQgT1XvF0B8utIAlIyaAVLkmj2PYcZ4hE /+rkOzUITMkGpjwjVFR295JNij1n1DjrSSPJjjtOZa89dJcVy8KfmelQ0oOEfaK84irf Wz6jRicuRxbXsUi8GeDvtg0sySPeiHu9nuwg4yLcuz/Q9H+PHCAKEWIWsXeOzv6acHXd 4gcQQt2UkjXbYB5Pfv8x1Sp/2t/f7w5OESSD/I7RVEUwrBytdV78utEshGjhr0JdOMJA lTXH4pcNpOWY1oxDZ9Ubb4ss/Gcceoyel70Cq08GN56X2MmqS8KVT5BnZo7z92nN90Si GTEQ== 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=EphGg1S+NyOV45KX8troj32fX7Y3pZq/MnWrLXjdGtmpvTMLLX6YAx0CtdREPjXtbX HNxRfkYs23J0/J52xlAsM5JHdMNMqni5I8Bre4iWuoV9C0GVqFsy0YZujJyfTFVhr3JO HGyLXiR8wjTEi7qaawPvRgP4vUMn5LYNOfWR3V5H1BOAjV3GrCybsGqBdAS2xJDbgyfK QDEOIbKX1oNSVWhajocq//Kw8Lcf/XII4NdCdaOw7XDMGEK74NHJx67iSySvV4IjKVeG 34oF+BQgkEXfSHdlL8CIkdh7dcEcFqssFiNIJswcuWKH2KSh11bVLJKnhPvLVyC5nyud oDLw== Received: by 10.180.88.195 with SMTP id bi3mr704816wib.3.1345246622961; Fri, 17 Aug 2012 16:37:02 -0700 (PDT) Received: by 10.180.88.195 with SMTP id bi3mr704805wib.3.1345246622911; Fri, 17 Aug 2012 16:37:02 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id d5si11752948eep.0.2012.08.17.16.37.02 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 17 Aug 2012 16:37:02 -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 B487520004E; Fri, 17 Aug 2012 16:37:02 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 175031801BB; Fri, 17 Aug 2012 16:37:02 -0700 (PDT) Subject: [PATCH v2 15/16] sgi-agp: Use list_for_each_entry() for bus->devices traversal To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: David Airlie , linux-pcmcia@lists.infradead.org, Yinghai Lu , Kenji Kaneshige Date: Fri, 17 Aug 2012 17:37:02 -0600 Message-ID: <20120817233702.10973.8426.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: ALoCoQnIFphTu+xcQNIg9kMo8DMxqWaUkB0v2zjikGXkMD/Afn5zuVyistvd1RY6EFimuRkKbonj7qF1VAelRSTKAFcnrQw1j+Lvd3Xi43nLdsO9KJmLK27xPDfP+C10ao7Picn0x8nb6/LlLyI3yJTU0dfbYs0EeLL3pz8Y8ls2kPS5FpcS02EkqWnp1txNXsr2MFyiwrhy+9m/LZ6PR9IjWZx//4+chg== 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);