public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
Cc: bjorn.helgaas@hp.com
Subject: [PATCH] PCI: trivial DBG tidy-up
Date: Fri, 1 Apr 2005 15:47:50 -0800	[thread overview]
Message-ID: <11123992702271@kroah.com> (raw)
In-Reply-To: <11123992703458@kroah.com>

ChangeSet 1.2181.16.8, 2005/03/17 13:50:00-08:00, bjorn.helgaas@hp.com

[PATCH] PCI: trivial DBG tidy-up

Tidy-up a bunch of PCI DBG output to use pci_name() when possible,
add domain when appropriate, remove redundancy, settle on one
style (DBG vs DBGC), etc.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


 drivers/pci/hotplug.c   |   10 ++++------
 drivers/pci/probe.c     |   13 +++++++------
 drivers/pci/setup-bus.c |   25 ++++++++++++-------------
 drivers/pci/setup-irq.c |    8 ++++----
 drivers/pci/setup-res.c |   14 +++++++-------
 5 files changed, 34 insertions(+), 36 deletions(-)


diff -Nru a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
--- a/drivers/pci/hotplug.c	2005-04-01 15:37:39 -08:00
+++ b/drivers/pci/hotplug.c	2005-04-01 15:37:39 -08:00
@@ -71,7 +71,8 @@
 	struct pci_dev_wrapped wrapped_dev;
 	int result = 0;
 
-	DBG("scanning bus %02x\n", wrapped_bus->bus->number);
+	DBG("PCI: Scanning bus %04x:%02x\n", pci_domain_nr(wrapped_bus->bus),
+		wrapped_bus->bus->number);
 
 	if (fn->pre_visit_pci_bus) {
 		result = fn->pre_visit_pci_bus(wrapped_bus, wrapped_parent);
@@ -106,8 +107,7 @@
 	struct pci_bus_wrapped wrapped_bus;
 	int result = 0;
 
-	DBG("scanning bridge %02x, %02x\n", PCI_SLOT(wrapped_dev->dev->devfn),
-	    PCI_FUNC(wrapped_dev->dev->devfn));
+	DBG("PCI: Scanning bridge %s\n", pci_name(wrapped_dev->dev));
 
 	if (fn->visit_pci_dev) {
 		result = fn->visit_pci_dev(wrapped_dev, wrapped_parent);
@@ -153,8 +153,7 @@
 				return result;
 			break;
 		default:
-			DBG("scanning device %02x, %02x\n",
-			    PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
+			DBG("PCI: Scanning device %s\n", pci_name(dev));
 			if (fn->visit_pci_dev) {
 				result = fn->visit_pci_dev (wrapped_dev,
 							    wrapped_parent);
@@ -169,4 +168,3 @@
 	return result;
 }
 EXPORT_SYMBOL(pci_visit_dev);
-
diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	2005-04-01 15:37:39 -08:00
+++ b/drivers/pci/probe.c	2005-04-01 15:37:39 -08:00
@@ -422,7 +422,7 @@
 
 	pci_read_config_dword(dev, PCI_PRIMARY_BUS, &buses);
 
-	DBG("Scanning behind PCI bridge %s, config %06x, pass %d\n",
+	DBG("PCI: Scanning behind PCI bridge %s, config %06x, pass %d\n",
 	    pci_name(dev), buses & 0xffffff, pass);
 
 	/* Disable MasterAbortMode during probing to avoid reporting
@@ -559,8 +559,8 @@
 	dev->class = class;
 	class >>= 8;
 
-	DBG("Found %02x:%02x [%04x/%04x] %06x %02x\n", dev->bus->number,
-	    dev->devfn, dev->vendor, dev->device, class, dev->hdr_type);
+	DBG("PCI: Found %s [%04x/%04x] %06x %02x\n", pci_name(dev),
+	    dev->vendor, dev->device, class, dev->hdr_type);
 
 	/* "Unknown power state" */
 	dev->current_state = 4;
@@ -815,7 +815,7 @@
 	unsigned int devfn, pass, max = bus->secondary;
 	struct pci_dev *dev;
 
-	DBG("Scanning bus %02x\n", bus->number);
+	DBG("PCI: Scanning bus %04x:%02x\n", pci_domain_nr(bus), bus->number);
 
 	/* Go find them, Rover! */
 	for (devfn = 0; devfn < 0x100; devfn += 8)
@@ -825,7 +825,7 @@
 	 * After performing arch-dependent fixup of the bus, look behind
 	 * all PCI-to-PCI bridges on this bus.
 	 */
-	DBG("Fixups for bus %02x\n", bus->number);
+	DBG("PCI: Fixups for bus %04x:%02x\n", pci_domain_nr(bus), bus->number);
 	pcibios_fixup_bus(bus);
 	for (pass=0; pass < 2; pass++)
 		list_for_each_entry(dev, &bus->devices, bus_list) {
@@ -841,7 +841,8 @@
 	 *
 	 * Return how far we've got finding sub-buses.
 	 */
-	DBG("Bus scan for %02x returning with max=%02x\n", bus->number, max);
+	DBG("PCI: Bus scan for %04x:%02x returning with max=%02x\n",
+		pci_domain_nr(bus), bus->number, max);
 	return max;
 }
 
diff -Nru a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
--- a/drivers/pci/setup-bus.c	2005-04-01 15:37:39 -08:00
+++ b/drivers/pci/setup-bus.c	2005-04-01 15:37:39 -08:00
@@ -29,9 +29,9 @@
 
 #define DEBUG_CONFIG 1
 #if DEBUG_CONFIG
-# define DBGC(args)     printk args
+#define DBG(x...)     printk(x)
 #else
-# define DBGC(args)
+#define DBG(x...)
 #endif
 
 #define ROUND_UP(x, a)		(((x) + (a) - 1) & ~((a) - 1))
@@ -151,8 +151,7 @@
 	struct pci_bus_region region;
 	u32 l, io_upper16;
 
-	DBGC((KERN_INFO "PCI: Bus %d, bridge: %s\n",
-			bus->number, pci_name(bridge)));
+	DBG(KERN_INFO "PCI: Bridge: %s\n", pci_name(bridge));
 
 	/* Set up the top and bottom of the PCI I/O segment for this bus. */
 	pcibios_resource_to_bus(bridge, &region, bus->resource[0]);
@@ -163,14 +162,14 @@
 		l |= region.end & 0xf000;
 		/* Set up upper 16 bits of I/O base/limit. */
 		io_upper16 = (region.end & 0xffff0000) | (region.start >> 16);
-		DBGC((KERN_INFO "  IO window: %04lx-%04lx\n",
-				region.start, region.end));
+		DBG(KERN_INFO "  IO window: %04lx-%04lx\n",
+				region.start, region.end);
 	}
 	else {
 		/* Clear upper 16 bits of I/O base/limit. */
 		io_upper16 = 0;
 		l = 0x00f0;
-		DBGC((KERN_INFO "  IO window: disabled.\n"));
+		DBG(KERN_INFO "  IO window: disabled.\n");
 	}
 	/* Temporarily disable the I/O range before updating PCI_IO_BASE. */
 	pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, 0x0000ffff);
@@ -185,12 +184,12 @@
 	if (bus->resource[1]->flags & IORESOURCE_MEM) {
 		l = (region.start >> 16) & 0xfff0;
 		l |= region.end & 0xfff00000;
-		DBGC((KERN_INFO "  MEM window: %08lx-%08lx\n",
-				region.start, region.end));
+		DBG(KERN_INFO "  MEM window: %08lx-%08lx\n",
+				region.start, region.end);
 	}
 	else {
 		l = 0x0000fff0;
-		DBGC((KERN_INFO "  MEM window: disabled.\n"));
+		DBG(KERN_INFO "  MEM window: disabled.\n");
 	}
 	pci_write_config_dword(bridge, PCI_MEMORY_BASE, l);
 
@@ -204,12 +203,12 @@
 	if (bus->resource[2]->flags & IORESOURCE_PREFETCH) {
 		l = (region.start >> 16) & 0xfff0;
 		l |= region.end & 0xfff00000;
-		DBGC((KERN_INFO "  PREFETCH window: %08lx-%08lx\n",
-				region.start, region.end));
+		DBG(KERN_INFO "  PREFETCH window: %08lx-%08lx\n",
+				region.start, region.end);
 	}
 	else {
 		l = 0x0000fff0;
-		DBGC((KERN_INFO "  PREFETCH window: disabled.\n"));
+		DBG(KERN_INFO "  PREFETCH window: disabled.\n");
 	}
 	pci_write_config_dword(bridge, PCI_PREF_MEMORY_BASE, l);
 
diff -Nru a/drivers/pci/setup-irq.c b/drivers/pci/setup-irq.c
--- a/drivers/pci/setup-irq.c	2005-04-01 15:37:39 -08:00
+++ b/drivers/pci/setup-irq.c	2005-04-01 15:37:39 -08:00
@@ -20,9 +20,9 @@
 
 #define DEBUG_CONFIG 0
 #if DEBUG_CONFIG
-# define DBGC(args)     printk args
+#define DBG(x...)     printk(x)
 #else
-# define DBGC(args)
+#define DBG(x...)
 #endif
 
 
@@ -53,8 +53,8 @@
 		irq = 0;
 	dev->irq = irq;
 
-	DBGC((KERN_ERR "PCI fixup irq: (%s) got %d\n", 
-		dev->dev.kobj.name, dev->irq));
+	DBG(KERN_ERR "PCI: fixup irq: (%s) got %d\n",
+		dev->dev.kobj.name, dev->irq);
 
 	/* Always tell the device, so the driver knows what is
 	   the real IRQ to use; the device does not use it. */
diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c	2005-04-01 15:37:39 -08:00
+++ b/drivers/pci/setup-res.c	2005-04-01 15:37:39 -08:00
@@ -27,9 +27,9 @@
 
 #define DEBUG_CONFIG 0
 #if DEBUG_CONFIG
-# define DBGC(args)     printk args
+#define DBG(x...)     printk(x)
 #else
-# define DBGC(args)
+#define DBG(x...)
 #endif
 
 
@@ -42,10 +42,10 @@
 
 	pcibios_resource_to_bus(dev, &region, res);
 
-	DBGC((KERN_ERR "  got res [%lx:%lx] bus [%lx:%lx] flags %lx for "
+	DBG(KERN_ERR "  got res [%lx:%lx] bus [%lx:%lx] flags %lx for "
 	      "BAR %d of %s\n", res->start, res->end,
 	      region.start, region.end, res->flags,
-	      resno, pci_name(dev)));
+	      resno, pci_name(dev));
 
 	new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
 	if (res->flags & IORESOURCE_IO)
@@ -60,7 +60,7 @@
 		reg = dev->rom_base_reg;
 	} else {
 		/* Hmm, non-standard resource. */
-		BUG();
+	
 		return;		/* kill uninitialised var warning */
 	}
 
@@ -85,9 +85,9 @@
 		}
 	}
 	res->flags &= ~IORESOURCE_UNSET;
-	DBGC((KERN_INFO "PCI: moved device %s resource %d (%lx) to %x\n",
+	DBG(KERN_INFO "PCI: moved device %s resource %d (%lx) to %x\n",
 		pci_name(dev), resno, res->flags,
-		new & ~PCI_REGION_FLAG_MASK));
+		new & ~PCI_REGION_FLAG_MASK);
 }
 
 int __devinit


  reply	other threads:[~2005-04-02  0:40 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-01 23:45 [BK PATCH] PCI update for 2.6.12-rc1 Greg KH
2005-04-01 23:47 ` PCI: increase the size of the pci.ids strings Greg KH
2005-04-01 23:47   ` Remove item from feature-removal-schedule.txt that was already removed from the kernel Greg KH
2005-04-01 23:47     ` PCI: add CONFIG_PCI_NAMES to the feature-removal-schedule.txt file Greg KH
2005-04-01 23:47       ` [PATCH] PCI: sync up with the latest pci.ids file from sf.net Greg KH
2005-04-01 23:47         ` [PATCH] PCI: Add PCI device ID for new Mellanox HCA Greg KH
2005-04-01 23:47           ` [PATCH] PCI: Patch for Serverworks chips in hotplug environment Greg KH
2005-04-01 23:47             ` PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed Greg KH
2005-04-01 23:47               ` Greg KH [this message]
2005-04-01 23:47                 ` [PATCH] PCI Hotplug: remove code duplication in drivers/pci/hotplug/ibmphp_pci.c Greg KH
2005-04-01 23:47                   ` [PATCH] PCI Hotplug: only call ibmphp_remove_resource() if argument is not NULL Greg KH
2005-04-01 23:47                     ` [PATCH] PCI: 80 column lines Greg KH
2005-04-01 23:47                       ` [PATCH] [PATCH] remove redundant devices list Greg KH
2005-04-01 23:47                         ` [PATCH] PCI busses are structs, not integers Greg KH
2005-04-01 23:47                           ` [PATCH] pci_ids.h correction for Intel ICH7M Greg KH
2005-04-01 23:47                             ` [PATCH] sort-out-pci_rom_address_enable-vs-ioresource_rom_enable.patch Greg KH
2005-04-01 23:47                               ` [PATCH] arch/i386/pci/i386.c: Use new for_each_pci_dev macro Greg KH
2005-04-01 23:47                                 ` PCI Hotplug: enforce the rule that a hotplug slot needs a release function Greg KH
2005-04-01 23:47                                   ` [PATCH] PCI Hotplug: add documentation about release pointer Greg KH
2005-04-01 23:47                                     ` [PATCH] PCI: Quirk for Asus M5N Greg KH
2005-04-01 23:47                                       ` [PATCH] drivers/pci/hotplug/cpqphp_core.c: fix a check after use Greg KH
2005-04-01 23:47                                         ` [PATCH] PCI: shrink drivers/pci/proc.c::pci_seq_start() Greg KH
2005-04-01 23:47                                           ` [PATCH] PCI: handle multiple video cards on the same bus Greg KH
2005-04-01 23:47                                             ` [PATCH] PCI: remove pci_find_device usage from pci sysfs code Greg KH
2005-04-01 23:47                                               ` [PATCH] drivers/pci/msi.c: fix a check after use Greg KH
2005-04-01 23:47                                                 ` PCI: clean up the dynamic id logic a little bit Greg KH
2005-04-01 23:47                                                   ` [PATCH] PCI: create PCI_DEBUG config option to make it easier for users to enable pci debugging Greg KH
2005-04-02 12:20                   ` [PATCH] PCI Hotplug: remove code duplication in drivers/pci/hotplug/ibmphp_pci.c Rolf Eike Beer
2005-04-02 19:26                     ` Andrew Morton
2005-04-08  0:07                     ` Greg KH
2005-04-08  7:02                       ` Rolf Eike Beer
2005-04-02  1:10               ` PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed Matthew Wilcox
2005-04-02  3:31                 ` Greg KH
2005-04-02  3:53                   ` Matthew Wilcox
2005-04-02  4:04                     ` Greg KH
2005-04-04 20:11   ` PCI: increase the size of the pci.ids strings Giuseppe Bilotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11123992702271@kroah.com \
    --to=gregkh@suse.de \
    --cc=bjorn.helgaas@hp.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox